Loading changes/ticket28077 0 → 100644 +3 −0 Original line number Diff line number Diff line o Code simplification and refactoring: - Remove unnecessarily unsafe code from the rust macro cstr!. Closes ticket 28077. src/rust/tor_util/strings.rs +1 −5 Original line number Diff line number Diff line Loading @@ -105,11 +105,7 @@ macro_rules! cstr { ($($bytes:expr),*) => ( ::std::ffi::CStr::from_bytes_with_nul( concat!($($bytes),*, "\0").as_bytes() ).unwrap_or( unsafe{ ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"\0") } ) ).unwrap_or_default() ) } Loading Loading
changes/ticket28077 0 → 100644 +3 −0 Original line number Diff line number Diff line o Code simplification and refactoring: - Remove unnecessarily unsafe code from the rust macro cstr!. Closes ticket 28077.
src/rust/tor_util/strings.rs +1 −5 Original line number Diff line number Diff line Loading @@ -105,11 +105,7 @@ macro_rules! cstr { ($($bytes:expr),*) => ( ::std::ffi::CStr::from_bytes_with_nul( concat!($($bytes),*, "\0").as_bytes() ).unwrap_or( unsafe{ ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"\0") } ) ).unwrap_or_default() ) } Loading