Fix Windows Clippy warnings

This commit is contained in:
David Peter
2026-10-05 14:07:39 +02:00
parent efd57b3a89
commit ebb3182a6e
+3 -6
View File
@@ -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<unsafe extern "system" fn(ProcessHandle: HANDLE) -> NTSTATUS> =
static NtResumeProcess: Lazy<unsafe extern "system" fn(process_handle: HANDLE) -> 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) };