From 4a3bef1e23b5eabe9abe3e0a22c7f5831bf705f7 Mon Sep 17 00:00:00 2001 From: Ran Benita Date: Sat, 16 Dec 2023 20:10:58 +0200 Subject: [PATCH] Make a drop explicit to please clippy ``` warning: unused return value of `std::ffi::CString::from_raw` that must be used --> pcsc/src/lib.rs:1016:18 | 1016 | unsafe { CString::from_raw(self.inner.szReader as *mut c_char) }; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = note: call `drop(from_raw(ptr))` if you intend to drop the `CString` = note: `#[warn(unused_must_use)]` on by default ``` --- pcsc/src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pcsc/src/lib.rs b/pcsc/src/lib.rs index ae904e4..a7ef11f 100644 --- a/pcsc/src/lib.rs +++ b/pcsc/src/lib.rs @@ -1013,7 +1013,7 @@ impl ReaderState { impl Drop for ReaderState { fn drop(&mut self) { // Reclaim the name and drop it immediately. - unsafe { CString::from_raw(self.inner.szReader as *mut c_char) }; + unsafe { drop(CString::from_raw(self.inner.szReader as *mut c_char)) }; } }