Skip to content

Commit

Permalink
Placate clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
nagisa committed Nov 6, 2022
1 parent 224a3de commit 95a0f62
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 7 deletions.
4 changes: 1 addition & 3 deletions src/os/unix/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -365,9 +365,7 @@ pub struct Symbol<T> {
impl<T> Symbol<T> {
/// Convert the loaded `Symbol` into a raw pointer.
pub fn into_raw(self) -> *mut raw::c_void {
let pointer = self.pointer;
mem::forget(self);
pointer
self.pointer
}
}

Expand Down
6 changes: 2 additions & 4 deletions src/os/windows/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,7 @@ impl fmt::Debug for Library {
let mut buf =
mem::MaybeUninit::<[mem::MaybeUninit::<WCHAR>; 1024]>::uninit().assume_init();
let len = libloaderapi::GetModuleFileNameW(self.0,
(&mut buf[..]).as_mut_ptr().cast(), 1024) as usize;
buf[..].as_mut_ptr().cast(), 1024) as usize;
if len == 0 {
f.write_str(&format!("Library@{:p}", self.0))
} else {
Expand All @@ -333,9 +333,7 @@ pub struct Symbol<T> {
impl<T> Symbol<T> {
/// Convert the loaded `Symbol` into a handle.
pub fn into_raw(self) -> FARPROC {
let pointer = self.pointer;
mem::forget(self);
pointer
self.pointer
}
}

Expand Down

0 comments on commit 95a0f62

Please sign in to comment.