mirror of
https://github.com/cargo-bins/cargo-binstall.git
synced 2025-06-15 15:16:37 +00:00
Fix clippy in windows.rs
Signed-off-by: Jiahao XU <30436523+NobodyXu@users.noreply.github.com>
This commit is contained in:
parent
a026dc2a4e
commit
744a358812
1 changed files with 2 additions and 2 deletions
|
@ -1,4 +1,4 @@
|
||||||
use std::{mem, ptr};
|
use std::mem;
|
||||||
use windows_sys::Win32::{
|
use windows_sys::Win32::{
|
||||||
Foundation::{HMODULE, S_OK},
|
Foundation::{HMODULE, S_OK},
|
||||||
System::{
|
System::{
|
||||||
|
@ -16,7 +16,7 @@ struct LibraryHandle(HMODULE);
|
||||||
impl LibraryHandle {
|
impl LibraryHandle {
|
||||||
fn new(name: &[u8]) -> Option<Self> {
|
fn new(name: &[u8]) -> Option<Self> {
|
||||||
let handle = unsafe { LoadLibraryA(name.as_ptr() as _) };
|
let handle = unsafe { LoadLibraryA(name.as_ptr() as _) };
|
||||||
(handle != ptr::null_mut()).then(|| Self(handle))
|
(!handle.is_null()).then_some(Self(handle))
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Get a function pointer to a function in the library.
|
/// Get a function pointer to a function in the library.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue