From e3b8a403ef11047f64971cb44cd5a00c64687e3f Mon Sep 17 00:00:00 2001 From: funman300 Date: Mon, 22 Jun 2026 11:39:21 -0700 Subject: [PATCH] style(engine): clear latent android-only clippy warnings in hud_plugin These six warnings only surfaced on an `aarch64-linux-android` clippy build; the host workspace gate never compiles the `cfg(target_os = "android")` HUD tap-toggle code, so they had accumulated unseen. - unqualify `Vec2` / `TouchInput` (reachable via the bevy prelude) in the android tap tracker, plugin wiring, and `toggle_hud_on_tap` signature - make the `PausedResource` import unconditional and unqualify its use in `handle_hint_button` (host-compiled, so the import had been android-gated purely to satisfy `toggle_hud_on_tap`) - allow `clippy::too_many_arguments` on the `toggle_hud_on_tap` Bevy system - collapse a nested `if let` / `if` into a let-chain Verified clean on both host `clippy -p solitaire_engine --all-targets -- -D warnings` and `aarch64-linux-android` clippy. Co-Authored-By: Claude Opus 4.8 (1M context) --- solitaire_engine/src/hud_plugin.rs | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/solitaire_engine/src/hud_plugin.rs b/solitaire_engine/src/hud_plugin.rs index c52c88f..b4a8808 100644 --- a/solitaire_engine/src/hud_plugin.rs +++ b/solitaire_engine/src/hud_plugin.rs @@ -36,7 +36,6 @@ use crate::game_plugin::GameMutation; use crate::input_plugin::TouchDragSet; use crate::layout::HUD_BAND_HEIGHT; use crate::layout::LayoutSystem; -#[cfg(target_os = "android")] use crate::pause_plugin::PausedResource; use crate::platform::{SHOW_KEYBOARD_ACCELERATORS, USE_TOUCH_UI_LAYOUT}; use crate::progress_plugin::ProgressResource; @@ -174,7 +173,7 @@ pub enum HudVisibility { #[cfg(target_os = "android")] #[derive(Resource, Debug, Default)] struct HudTapTracker { - start_pos: Option, + start_pos: Option, /// Set `true` when the finger-down hit an action button so the /// finger-up never toggles bar visibility. started_on_button: bool, @@ -529,7 +528,7 @@ impl Plugin for HudPlugin { #[cfg(target_os = "android")] { app.init_resource::() - .add_message::() + .add_message::() .add_systems( Update, toggle_hud_on_tap @@ -1140,7 +1139,7 @@ fn handle_help_button( fn handle_hint_button( interaction_query: Query<&Interaction, (With, Changed)>, - paused: Option>, + paused: Option>, game: Option>, solver_config: Option>, mut pending_hint: Option>, @@ -2658,8 +2657,9 @@ fn resize_action_bar_labels( } #[cfg(target_os = "android")] +#[allow(clippy::too_many_arguments)] fn toggle_hud_on_tap( - mut touch_events: MessageReader, + mut touch_events: MessageReader, drag: Res, scrims: Query<(), With>, paused: Option>, @@ -2697,13 +2697,14 @@ fn toggle_hud_on_tap( // regardless of whether we toggle. let on_button = tracker.started_on_button || game_consumed.0; game_consumed.0 = false; - if let Some(start) = tracker.start_pos.take() { - if !on_button && (event.position - start).length() < HUD_TAP_SLOP_PX { - *hud_vis = match *hud_vis { - HudVisibility::Visible => HudVisibility::Hidden, - HudVisibility::Hidden => HudVisibility::Visible, - }; - } + if let Some(start) = tracker.start_pos.take() + && !on_button + && (event.position - start).length() < HUD_TAP_SLOP_PX + { + *hud_vis = match *hud_vis { + HudVisibility::Visible => HudVisibility::Hidden, + HudVisibility::Hidden => HudVisibility::Visible, + }; } tracker.started_on_button = false; }