From 744a358812b0ef234bc5207959e210b45265e68d Mon Sep 17 00:00:00 2001 From: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> Date: Sat, 3 Aug 2024 14:00:13 +1000 Subject: [PATCH] Fix clippy in windows.rs Signed-off-by: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> --- crates/detect-targets/src/detect/windows.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/crates/detect-targets/src/detect/windows.rs b/crates/detect-targets/src/detect/windows.rs index dbf38019..5bb397cb 100644 --- a/crates/detect-targets/src/detect/windows.rs +++ b/crates/detect-targets/src/detect/windows.rs @@ -1,4 +1,4 @@ -use std::{mem, ptr}; +use std::mem; use windows_sys::Win32::{ Foundation::{HMODULE, S_OK}, System::{ @@ -16,7 +16,7 @@ struct LibraryHandle(HMODULE); impl LibraryHandle { fn new(name: &[u8]) -> Option { 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.