Merge pull request #4781 from sunfishcode/sunfishcode/fix-warning

Fix a warning in upstream code on Rust nightly.
This commit is contained in:
Sylvestre Ledru
2023-04-25 07:57:02 +02:00
committed by GitHub
+2 -1
View File
@@ -321,7 +321,8 @@ macro_rules! f {
} else {
// SAFETY: We're holding PW_LOCK.
unsafe {
let data = $fnam(CString::new(k).unwrap().as_ptr());
let cstring = CString::new(k).unwrap();
let data = $fnam(cstring.as_ptr());
if !data.is_null() {
Ok($st::from_raw(ptr::read(data as *const _)))
} else {