From d44067335422c7c6c4e2be725d33e1f36baac68c Mon Sep 17 00:00:00 2001 From: donpat1to Date: Sat, 2 Aug 2025 16:22:48 +0200 Subject: [PATCH] removed unused imports --- WatcherAgent/src/main.rs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/WatcherAgent/src/main.rs b/WatcherAgent/src/main.rs index 28ccb82..cfd1ce4 100644 --- a/WatcherAgent/src/main.rs +++ b/WatcherAgent/src/main.rs @@ -467,10 +467,15 @@ fn get_cpu_temp() -> Option { None } + #[cfg(target_os = "windows")] + fn failed(hr: winapi::shared::winerror::HRESULT) -> bool { + hr < 0 + } + #[cfg(target_os = "windows")] { use com::runtime::init_runtime; - use com::sys::{CLSCTX_INPROC_SERVER, FAILED}; + use com::sys::CLSCTX_INPROC_SERVER; use widestring::U16CString; use winapi::shared::rpcdce::*; use winapi::shared::wtypes::VT_I4; @@ -566,7 +571,7 @@ fn get_cpu_temp() -> Option { &mut returned, ); - if FAILED(hr) { + if failed(hr) { eprintln!("Failed to enumerate WMI objects (HRESULT: {})", hr); (*enumerator).Release(); continue;