Skip to content
Myr

Merge pull request #977 from sharkdp/codex/fix-clippy-warnings

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Fix Windows Clippy warnings

authored by David Peter · committed by GitHub · parents f48f44b, ebb3182 · Browse files · 1 file+3 added−6 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+3 added−6 removed

  • other:+3 added−6 removed

1 file+3 added−6 removed

modified:src/timer/windows_timer.rs+3 added-6 removed
32 unmodified lines
33use crate::quantity::{nanosecond, Information, Time, Zero};3435#[cfg(not(feature = "windows_process_extensions_main_thread_handle"))]36#[allow(non_upper_case_globals)]37static NtResumeProcess: Lazy<unsafe extern "system" fn(ProcessHandle: HANDLE) -> NTSTATUS> =37static NtResumeProcess: Lazy<unsafe extern "system" fn(process_handle: HANDLE) -> NTSTATUS> =38 Lazy::new(|| {39 // SAFETY: Getting the module handle for ntdll.dll is safe40 let ntdll = unsafe { GetModuleHandleW(w!("ntdll.dll")) };41 assert!(ntdll != std::ptr::null_mut(), "GetModuleHandleW failed");41 assert!(!ntdll.is_null(), "GetModuleHandleW failed");4243 // SAFETY: The ntdll handle is valid44 let nt_resume_process = unsafe { GetProcAddress(ntdll, s!("NtResumeProcess")) };45
10 unmodified lines
56 let child_handle = child.as_raw_handle() as HANDLE;5758 // SAFETY: Creating a new job object is safe59 let job_object = unsafe { CreateJobObjectW(ptr::null_mut(), ptr::null_mut()) };60 assert!(61 job_object != std::ptr::null_mut(),62 "CreateJobObjectW failed"63 );60 assert!(!job_object.is_null(), "CreateJobObjectW failed");6162 // SAFETY: The job object handle is valid63 let ret = unsafe { AssignProcessToJobObject(job_object, child_handle) };64 assert!(ret != 0, "AssignProcessToJobObject failed");
67 unmodified lines