Make rustc stop complaining about unused `Box::from_raw`s
[ldk-c-bindings] / c-bindings-gen / src / blocks.rs
index e6d1528c7f97084d7764e0add0651c0ff9679a00..28f30026ed0810ef0263be3a8b4636a234d59b54 100644 (file)
@@ -250,7 +250,7 @@ pub fn write_vec_block<W: std::io::Write>(w: &mut W, mangled_container: &str, in
        writeln!(w, "impl Drop for {} {{", mangled_container).unwrap();
        writeln!(w, "\tfn drop(&mut self) {{").unwrap();
        writeln!(w, "\t\tif self.datalen == 0 {{ return; }}").unwrap();
-       writeln!(w, "\t\tunsafe {{ Box::from_raw(core::slice::from_raw_parts_mut(self.data, self.datalen)) }};").unwrap();
+       writeln!(w, "\t\tlet _ = unsafe {{ Box::from_raw(core::slice::from_raw_parts_mut(self.data, self.datalen)) }};").unwrap();
        writeln!(w, "\t}}").unwrap();
        writeln!(w, "}}").unwrap();
        if clonable {