-
Notifications
You must be signed in to change notification settings - Fork 15
Open
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
};aapoalas
Metadata
Metadata
Assignees
Labels
No labels