diff --git a/windows/src-tauri/src/lib.rs b/windows/src-tauri/src/lib.rs index a19734e4..72f5f007 100644 --- a/windows/src-tauri/src/lib.rs +++ b/windows/src-tauri/src/lib.rs @@ -1,3 +1,7 @@ +// Linux builds compile the Windows-only dock, session and tray-status code but never +// call it (that platform runs its own SNI tray), so dead-code lints are for Windows only. +#![cfg_attr(not(windows), allow(dead_code))] + mod autostart; mod cli; mod config; @@ -832,6 +836,9 @@ mod commands { use serde_json::Value; use tauri::{AppHandle, Emitter, Manager, State}; + // Every argument is one field of the payload query; a struct would only move the + // count into the frontend's invoke call. + #[allow(clippy::too_many_arguments)] #[tauri::command] pub async fn fetch_payload( app: AppHandle, diff --git a/windows/src-tauri/src/settings.rs b/windows/src-tauri/src/settings.rs index 1f2ba379..65de3487 100644 --- a/windows/src-tauri/src/settings.rs +++ b/windows/src-tauri/src/settings.rs @@ -284,7 +284,7 @@ fn seal(plain: &[u8]) -> Result> { use windows_sys::Win32::Security::Cryptography::{CryptProtectData, CRYPT_INTEGER_BLOB}; use windows_sys::Win32::Foundation::LocalFree; - let mut input = CRYPT_INTEGER_BLOB { + let input = CRYPT_INTEGER_BLOB { cbData: plain.len() as u32, pbData: plain.as_ptr() as *mut u8, }; @@ -294,7 +294,7 @@ fn seal(plain: &[u8]) -> Result> { }; let ok = unsafe { CryptProtectData( - &mut input, + &input, std::ptr::null(), std::ptr::null(), std::ptr::null(), @@ -320,7 +320,7 @@ fn unseal(sealed: &[u8]) -> Result> { use windows_sys::Win32::Security::Cryptography::{CryptUnprotectData, CRYPT_INTEGER_BLOB}; use windows_sys::Win32::Foundation::LocalFree; - let mut input = CRYPT_INTEGER_BLOB { + let input = CRYPT_INTEGER_BLOB { cbData: sealed.len() as u32, pbData: sealed.as_ptr() as *mut u8, }; @@ -330,7 +330,7 @@ fn unseal(sealed: &[u8]) -> Result> { }; let ok = unsafe { CryptUnprotectData( - &mut input, + &input, std::ptr::null_mut(), std::ptr::null(), std::ptr::null(),