From ebb3182a6e618d578bff9d9e21d781f635ebe170 Mon Sep 17 00:00:00 2001 From: David Peter Date: Mon, 5 Oct 2026 14:07:39 +0200 Subject: [PATCH] Fix Windows Clippy warnings --- src/timer/windows_timer.rs | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/timer/windows_timer.rs b/src/timer/windows_timer.rs index 4363990..e48e288 100644 --- a/src/timer/windows_timer.rs +++ b/src/timer/windows_timer.rs @@ -34,11 +34,11 @@ use crate::quantity::{nanosecond, Information, Time, Zero}; #[cfg(not(feature = "windows_process_extensions_main_thread_handle"))] #[allow(non_upper_case_globals)] -static NtResumeProcess: Lazy NTSTATUS> = +static NtResumeProcess: Lazy NTSTATUS> = Lazy::new(|| { // SAFETY: Getting the module handle for ntdll.dll is safe let ntdll = unsafe { GetModuleHandleW(w!("ntdll.dll")) }; - assert!(ntdll != std::ptr::null_mut(), "GetModuleHandleW failed"); + assert!(!ntdll.is_null(), "GetModuleHandleW failed"); // SAFETY: The ntdll handle is valid let nt_resume_process = unsafe { GetProcAddress(ntdll, s!("NtResumeProcess")) }; @@ -57,10 +57,7 @@ impl CPUTimer { // SAFETY: Creating a new job object is safe let job_object = unsafe { CreateJobObjectW(ptr::null_mut(), ptr::null_mut()) }; - assert!( - job_object != std::ptr::null_mut(), - "CreateJobObjectW failed" - ); + assert!(!job_object.is_null(), "CreateJobObjectW failed"); // SAFETY: The job object handle is valid let ret = unsafe { AssignProcessToJobObject(job_object, child_handle) };