Skip to content

Commit 21d80fd

Browse files
committed
chore: linting
1 parent 3732d3a commit 21d80fd

File tree

2 files changed

+12
-12
lines changed

2 files changed

+12
-12
lines changed

src-tauri/Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,6 @@ objc2-app-kit = { version = "0.3.2", features = ["NSWindow", "NSApplication", "N
127127
winreg = "0.55"
128128
windows = { version = "0.62", features = [
129129
"Win32_Foundation",
130-
"Win32_System_Console",
131130
"Win32_System_ProcessStatus",
132131
"Win32_System_Threading",
133132
"Win32_System_Diagnostics_Debug",

src-tauri/src/bin/donut_daemon.rs

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -190,21 +190,22 @@ fn run_daemon() {
190190
}
191191

192192
#[cfg(windows)]
193-
unsafe {
194-
use windows::Win32::System::Console::{SetConsoleCtrlHandler, PHANDLER_ROUTINE};
193+
{
194+
extern "system" {
195+
fn SetConsoleCtrlHandler(
196+
handler: Option<unsafe extern "system" fn(u32) -> i32>,
197+
add: i32,
198+
) -> i32;
199+
}
195200

196-
unsafe extern "system" fn ctrl_handler(_ctrl_type: u32) -> windows::Win32::Foundation::BOOL {
201+
unsafe extern "system" fn ctrl_handler(_ctrl_type: u32) -> i32 {
197202
SHOULD_QUIT.store(true, std::sync::atomic::Ordering::SeqCst);
198-
windows::Win32::Foundation::TRUE
203+
1 // TRUE
199204
}
200205

201-
let _ = SetConsoleCtrlHandler(
202-
Some(std::mem::transmute::<
203-
unsafe extern "system" fn(u32) -> windows::Win32::Foundation::BOOL,
204-
PHANDLER_ROUTINE,
205-
>(ctrl_handler)),
206-
true,
207-
);
206+
unsafe {
207+
SetConsoleCtrlHandler(Some(ctrl_handler), 1);
208+
}
208209
}
209210

210211
// Run the event loop

0 commit comments

Comments
 (0)