[pbs-devel] [RFC proxmox-backup-qemu 4/6] lint fix: explicitly drop Box

Fabian Grünbichler f.gruenbichler at proxmox.com
Mon Dec 12 13:05:39 CET 2022


else this complains about a missing usage of the return value..

Signed-off-by: Fabian Grünbichler <f.gruenbichler at proxmox.com>
---

Notes:
    this is kinda stupid since Box' drop is empty anyway..

 src/lib.rs | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/lib.rs b/src/lib.rs
index bdd162b..b3c7b85 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -1193,7 +1193,7 @@ pub extern "C" fn proxmox_import_state(buf: *const u8, buf_size: usize) {
 pub extern "C" fn proxmox_free_state_buf(buf: *mut u8) {
     if !buf.is_null() {
         unsafe {
-            Box::from_raw(buf);
+            drop(Box::from_raw(buf));
         }
     }
 }
-- 
2.30.2






More information about the pbs-devel mailing list