/// builds.
#[macro_export]
macro_rules! const_cstr {
- ($s:expr) => ({
+ ($s:expr) => {{
use std::ffi::CStr;
let str_plus_nul = concat!($s, "\0");
if cfg!(debug_assertions) {
CStr::from_bytes_with_nul(str_plus_nul.as_bytes()).unwrap()
} else {
- unsafe {
- CStr::from_bytes_with_nul_unchecked(str_plus_nul.as_bytes())
- }
+ unsafe { CStr::from_bytes_with_nul_unchecked(str_plus_nul.as_bytes()) }
}
- })
+ }};
}