fix(windows): clear the clippy errors that fail the tray CI on both platforms

The DPAPI calls took `&mut input` for a blob they only read, the dock's
payload command has one argument more than clippy's default limit, and
the Linux leg compiles the Windows-only dock, session and tray-status
code without calling it, which tripped 25 dead-code lints under
`-D warnings`. Dead-code lints now apply on Windows only, where every
function is reachable.
This commit is contained in:
iamtoruk 2026-09-02 14:28:08 -07:00
parent 62cb4f8630
commit 0560d5a5bd
2 changed files with 11 additions and 4 deletions

View file

@ -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,

View file

@ -284,7 +284,7 @@ fn seal(plain: &[u8]) -> Result<Vec<u8>> {
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<Vec<u8>> {
};
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<Vec<u8>> {
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<Vec<u8>> {
};
let ok = unsafe {
CryptUnprotectData(
&mut input,
&input,
std::ptr::null_mut(),
std::ptr::null(),
std::ptr::null(),