Skip to content

Commit

Permalink
Make a drop explicit to please clippy
Browse files Browse the repository at this point in the history
```
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
```
  • Loading branch information
bluetech committed Dec 16, 2023
1 parent 3246972 commit 4a3bef1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pcsc/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)) };
}
}

Expand Down

0 comments on commit 4a3bef1

Please sign in to comment.