oxidecomputer / oxidecomputer/usdt
Support CStr
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 145
- Forks
- 15
- Avg merge
- 14m
- Merged PRs (30d)
- 6
Description
I noticed that passing &str or String requires converting to a &[u8] where you then push a nul byte. It would be nice to support CStr as well to avoid this alloc.
Additionally, instead of doing
// args.1: String
let arg_1 = [(args.1.as_ref() as &str).as_bytes(), &[0_u8]].concat();
it would likely be better instead to do
let arg_1 = {
let mut bytes = args.1.into_bytes();
bytes.push(0);
bytes
};
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
The issue names no files or tests. Start by locating the argument conversion path that handles &str and String, then inspect nearby tests or examples for supported argument types. Done means CStr is accepted without the caller needing to construct a nul-terminated byte buffer, while the suggested String conversion is addressed as appropriate.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- devtools, observability-sre
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100