From c9128cb19bffd0e6560048b5c42a4029460f1cf6 Mon Sep 17 00:00:00 2001 From: oyvindln Date: Thu, 22 Dec 2022 18:56:44 +0100 Subject: [PATCH] Fix warnings in miniz_oxide_c_api --- benches/bench.rs | 8 ++++---- src/tdef.rs | 2 +- src/tinfl.rs | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/benches/bench.rs b/benches/bench.rs index 985c8501..d30deaa1 100755 --- a/benches/bench.rs +++ b/benches/bench.rs @@ -224,10 +224,10 @@ mod miniz { use super::*; use libc::{c_int, c_void}; - /// Functions from miniz - /// We add the link attribute to make sure - /// these are linked to the miniz ones rather than - /// picking up the rust versions (as they may be exported). + // Functions from miniz + // We add the link attribute to make sure + // these are linked to the miniz ones rather than + // picking up the rust versions (as they may be exported). #[link(name = "miniz", kind = "static")] extern "C" { fn tinfl_decompress_mem_to_heap( diff --git a/src/tdef.rs b/src/tdef.rs index 8dfb81e3..ef42d0af 100644 --- a/src/tdef.rs +++ b/src/tdef.rs @@ -262,7 +262,7 @@ unmangle!( /// allocated by it. pub unsafe extern "C" fn tdefl_deallocate(c: *mut Compressor) { if !c.is_null() { - Box::from_raw(c); + drop(Box::from_raw(c)); } } diff --git a/src/tinfl.rs b/src/tinfl.rs index 16ff7abe..69433193 100755 --- a/src/tinfl.rs +++ b/src/tinfl.rs @@ -222,7 +222,7 @@ unmangle!( /// allocated by it. pub unsafe extern "C" fn tinfl_decompressor_free(c: *mut tinfl_decompressor) { if !c.is_null() { - Box::from_raw(c); + drop(Box::from_raw(c)); } }