chore: linting

This commit is contained in:
zhom
2026-02-22 10:50:21 +04:00
parent 3732d3a6e1
commit 21d80fde56
2 changed files with 14 additions and 14 deletions
-1
View File
@@ -127,7 +127,6 @@ objc2-app-kit = { version = "0.3.2", features = ["NSWindow", "NSApplication", "N
winreg = "0.55"
windows = { version = "0.62", features = [
"Win32_Foundation",
"Win32_System_Console",
"Win32_System_ProcessStatus",
"Win32_System_Threading",
"Win32_System_Diagnostics_Debug",
+14 -13
View File
@@ -190,21 +190,22 @@ fn run_daemon() {
}
#[cfg(windows)]
unsafe {
use windows::Win32::System::Console::{SetConsoleCtrlHandler, PHANDLER_ROUTINE};
unsafe extern "system" fn ctrl_handler(_ctrl_type: u32) -> windows::Win32::Foundation::BOOL {
SHOULD_QUIT.store(true, std::sync::atomic::Ordering::SeqCst);
windows::Win32::Foundation::TRUE
{
extern "system" {
fn SetConsoleCtrlHandler(
handler: Option<unsafe extern "system" fn(u32) -> i32>,
add: i32,
) -> i32;
}
let _ = SetConsoleCtrlHandler(
Some(std::mem::transmute::<
unsafe extern "system" fn(u32) -> windows::Win32::Foundation::BOOL,
PHANDLER_ROUTINE,
>(ctrl_handler)),
true,
);
unsafe extern "system" fn ctrl_handler(_ctrl_type: u32) -> i32 {
SHOULD_QUIT.store(true, std::sync::atomic::Ordering::SeqCst);
1 // TRUE
}
unsafe {
SetConsoleCtrlHandler(Some(ctrl_handler), 1);
}
}
// Run the event loop