lang: update c_str
drop the let binding, easier to use in const context since CStr::from_bytes_with_nul_unchecked is const since 1.59 Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
This commit is contained in:
parent
34d2c91118
commit
4de145aaef
@ -106,8 +106,7 @@ macro_rules! offsetof {
|
||||
#[macro_export]
|
||||
macro_rules! c_str {
|
||||
($data:expr) => {{
|
||||
let bytes = concat!($data, "\0");
|
||||
unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(bytes.as_bytes()) }
|
||||
unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(concat!($data, "\0").as_bytes()) }
|
||||
}};
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user