Skip to content

Commit 95a0f62

Browse files
committed
Placate clippy
1 parent 224a3de commit 95a0f62

File tree

2 files changed

+3
-7
lines changed

2 files changed

+3
-7
lines changed

src/os/unix/mod.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -365,9 +365,7 @@ pub struct Symbol<T> {
365365
impl<T> Symbol<T> {
366366
/// Convert the loaded `Symbol` into a raw pointer.
367367
pub fn into_raw(self) -> *mut raw::c_void {
368-
let pointer = self.pointer;
369-
mem::forget(self);
370-
pointer
368+
self.pointer
371369
}
372370
}
373371

src/os/windows/mod.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -307,7 +307,7 @@ impl fmt::Debug for Library {
307307
let mut buf =
308308
mem::MaybeUninit::<[mem::MaybeUninit::<WCHAR>; 1024]>::uninit().assume_init();
309309
let len = libloaderapi::GetModuleFileNameW(self.0,
310-
(&mut buf[..]).as_mut_ptr().cast(), 1024) as usize;
310+
buf[..].as_mut_ptr().cast(), 1024) as usize;
311311
if len == 0 {
312312
f.write_str(&format!("Library@{:p}", self.0))
313313
} else {
@@ -333,9 +333,7 @@ pub struct Symbol<T> {
333333
impl<T> Symbol<T> {
334334
/// Convert the loaded `Symbol` into a handle.
335335
pub fn into_raw(self) -> FARPROC {
336-
let pointer = self.pointer;
337-
mem::forget(self);
338-
pointer
336+
self.pointer
339337
}
340338
}
341339

0 commit comments

Comments
 (0)