From b72112ff7809cdf5af7f456a4209d8cfcd151659 Mon Sep 17 00:00:00 2001 From: Trevor Brown Date: Thu, 12 Nov 2026 14:42:55 -0500 Subject: [PATCH] Clippy 1.100: fix the new needless_bool and unused ExitCode lints CI now installs rustc/clippy 1.100.0, which flags code nobody changed. No behaviour changes. - clippy::needless_bool: crates/ui-egui/src/shortcuts.rs (end of the arrow-key handler), the `if ... { return true; } false` tail becomes the boolean expression itself. - unused_must_use (`test::ExitCode`): apps/figcraft-cli/src/files.rs, three tests that call `run_script(...).unwrap()` and only check the output file; the result is now bound with `let _ =`. Co-Authored-By: Claude Sonnet 5.5 Model-Effort: Opus 5.5 drove; Opus 5.5 briefed; Sonnet 5.5 wrote at medium --- apps/figcraft-cli/src/files.rs | 6 +++--- crates/ui-egui/src/shortcuts.rs | 5 +---- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/apps/figcraft-cli/src/files.rs b/apps/figcraft-cli/src/files.rs index a7bddeb3b..a2d6265fb 100644 --- a/apps/figcraft-cli/src/files.rs +++ b/apps/figcraft-cli/src/files.rs @@ -670,7 +670,7 @@ mod tests { ) .unwrap(); let out = dir.join("out.figcraft"); - run_script(script.to_str().unwrap(), None, Some(out.to_str().unwrap())).unwrap(); + let _ = run_script(script.to_str().unwrap(), None, Some(out.to_str().unwrap())).unwrap(); let mut s = Session::empty(); s.execute("file.open", &json!({"path": out.to_str().unwrap()})).unwrap(); @@ -700,7 +700,7 @@ mod tests { ) .unwrap(); let out = dir.join("out.figcraft"); - run_script(script.to_str().unwrap(), None, Some(out.to_str().unwrap())).unwrap(); + let _ = run_script(script.to_str().unwrap(), None, Some(out.to_str().unwrap())).unwrap(); let mut s = Session::empty(); s.execute("file.open", &json!({"path": out.to_str().unwrap()})).unwrap(); @@ -737,7 +737,7 @@ mod tests { .unwrap(); let out = dir.join("out.figcraft"); // The failure is the script's, not the call's: the CLI reports it and exits non-zero. - run_script(script.to_str().unwrap(), None, Some(out.to_str().unwrap())).unwrap(); + let _ = run_script(script.to_str().unwrap(), None, Some(out.to_str().unwrap())).unwrap(); assert!(!out.exists(), "a script that failed writes nothing"); std::fs::remove_dir_all(dir).unwrap(); } diff --git a/crates/ui-egui/src/shortcuts.rs b/crates/ui-egui/src/shortcuts.rs index 3d312387b..1cac67b4b 100644 --- a/crates/ui-egui/src/shortcuts.rs +++ b/crates/ui-egui/src/shortcuts.rs @@ -521,10 +521,7 @@ fn key_event(app: &mut FigApp, key: Key, physical: Option, m: Modifiers, re } return true; } - if m.is_none() && !repeat && opacity_digit(app, key, now) { - return true; - } - false + m.is_none() && !repeat && opacity_digit(app, key, now) } /// Keys while a selection box drawn from the keyboard shows (`select.area`, Alt+Space or Ctrl+Space,