diff --git a/src-tauri/Cargo.toml b/src-tauri/Cargo.toml index 5d84502c..46a8d8e7 100644 --- a/src-tauri/Cargo.toml +++ b/src-tauri/Cargo.toml @@ -20,7 +20,7 @@ tauri = { version = "2.11.3", features = [] } # generate_context! expands plugin config (plugins.updater) via serde_json. serde_json = "1" serde = { version = "1", features = ["derive"] } -tokio = { version = "1", features = ["net", "time", "io-util", "rt"] } +tokio = { version = "1.53.3", features = ["net", "time", "io-util", "rt"] } # Preview proxy only (redirects disabled there); rustls to match sqlx. reqwest = { version = "0.12", default-features = false, features = ["rustls-tls"] } base64 = "0.23" diff --git a/src-tauri/src/usb.rs b/src-tauri/src/usb.rs index 1f0b66d0..c0fe3b3f 100644 --- a/src-tauri/src/usb.rs +++ b/src-tauri/src/usb.rs @@ -431,7 +431,8 @@ mod lp_io { impl LpDevice { pub(super) fn new(file: File) -> std::io::Result { - Ok(Self(AsyncFd::new(file)?)) + // SAFETY: the File owns the fd for the whole lifetime of the AsyncFd. + Ok(Self(unsafe { AsyncFd::register(file) }?)) } }