From 58ad0b8796dc7416e20d5c44eddf2cf75af42edd Mon Sep 17 00:00:00 2001 From: Eric Florenzano Date: Mon, 20 Apr 2026 01:02:23 +0000 Subject: [PATCH] Desktop: fix macos clippy on handle_run_event (needless_pass_by_value) Take RunEvent by reference in handle_run_event and convert the app.run closure to pass &event. Fixes the macos-latest clippy job introduced in #324: error: this argument is passed by value, but not consumed in the function body On Linux/Windows the non-macos variant uses _event which silenced the lint there; macOS used the owned form and tripped -D warnings. Co-Authored-By: Claude Opus 4.7 (1M context) --- crates/modelrelay-desktop/src/main.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/crates/modelrelay-desktop/src/main.rs b/crates/modelrelay-desktop/src/main.rs index 07ba391..fabbb41 100644 --- a/crates/modelrelay-desktop/src/main.rs +++ b/crates/modelrelay-desktop/src/main.rs @@ -212,11 +212,11 @@ fn main() { .build(tauri::generate_context!()) .expect("error while building tauri application"); - app.run(handle_run_event); + app.run(|app, event| handle_run_event(app, &event)); } #[cfg(target_os = "macos")] -fn handle_run_event(app: &AppHandle, event: RunEvent) { +fn handle_run_event(app: &AppHandle, event: &RunEvent) { // macOS sends Reopen when the user clicks the Dock icon or re-launches the // app from Finder while a copy is already running. Without handling it, the // second launch does nothing visible — exactly the "busted if you're authed" @@ -227,4 +227,4 @@ fn handle_run_event(app: &AppHandle, event: RunEvent) { } #[cfg(not(target_os = "macos"))] -fn handle_run_event(_app: &AppHandle, _event: RunEvent) {} +fn handle_run_event(_app: &AppHandle, _event: &RunEvent) {}