From 5a2df44e791035c1a54f47e6ee1b1b988cb9a8ed Mon Sep 17 00:00:00 2001 From: David Tolnay Date: Sat, 7 Dec 2024 14:29:32 -0800 Subject: [PATCH] Resolve warning on Windows with debug `cargo check --target=x86_64-pc-windows-msvc --features=debug` warning: function `display_ntstatus_error` is never used --> src/windows/process.rs:229:11 | 229 | unsafe fn display_ntstatus_error(ntstatus: windows::core::HRESULT) { | ^^^^^^^^^^^^^^^^^^^^^^ | = note: `#[warn(dead_code)]` on by default --- src/windows/process.rs | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/src/windows/process.rs b/src/windows/process.rs index 373d00e49..e037b47aa 100644 --- a/src/windows/process.rs +++ b/src/windows/process.rs @@ -225,17 +225,6 @@ fn windows_8_1_or_newer() -> &'static bool { }) } -#[cfg(feature = "debug")] -unsafe fn display_ntstatus_error(ntstatus: windows::core::HRESULT) { - let code = ntstatus.0; - let message = ntstatus.message(); - sysinfo_debug!( - "Couldn't get process infos: NtQuerySystemInformation returned {}: {}", - code, - message - ); -} - unsafe fn get_exe(process_handler: &HandleWrapper) -> Option { let mut exe_buf = [0u16; MAX_PATH as usize + 1]; GetModuleFileNameExW(