mirror of
https://github.com/sharkdp/hyperfine.git
synced 2026-10-12 02:22:35 +00:00
Fix Windows Clippy warnings
This commit is contained in:
@@ -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) };
|
||||
|
||||
Reference in New Issue
Block a user