From a01f86f092957c625904508ffbdc2e1ac0ff55db Mon Sep 17 00:00:00 2001 From: Manuel Mauro Date: Mon, 1 Apr 2024 10:22:51 +0200 Subject: [PATCH] Clippy --- src/game/button.rs | 11 ++++++----- src/game/mod.rs | 3 ++- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/src/game/button.rs b/src/game/button.rs index c0ea22b..f49e54e 100644 --- a/src/game/button.rs +++ b/src/game/button.rs @@ -29,6 +29,7 @@ impl Plugin for GameButtonPlugin { } } +#[allow(clippy::type_complexity)] fn button_system( mut query: Query< (&Interaction, &mut BackgroundColor, &mut BorderColor), @@ -39,15 +40,15 @@ fn button_system( match *interaction { Interaction::Pressed => { *color = config::PRESSED_BUTTON.into(); - border_color.0 = config::BUTTON_BORDER_COLOR.into(); + border_color.0 = config::BUTTON_BORDER_COLOR; } Interaction::Hovered => { *color = config::HOVERED_BUTTON.into(); - border_color.0 = config::BUTTON_BORDER_COLOR.into(); + border_color.0 = config::BUTTON_BORDER_COLOR; } Interaction::None => { *color = config::NORMAL_BUTTON.into(); - border_color.0 = config::BUTTON_BORDER_COLOR.into(); + border_color.0 = config::BUTTON_BORDER_COLOR; } } } @@ -60,12 +61,12 @@ fn button_shortcut_system( for (mut color, mut border_color, shortcut) in &mut query { if keyboard_input.pressed(shortcut.0) { *color = config::PRESSED_BUTTON.into(); - border_color.0 = config::PRESSED_BUTTON_BORDER_COLOR.into(); + border_color.0 = config::PRESSED_BUTTON_BORDER_COLOR; } if keyboard_input.just_released(shortcut.0) { *color = config::NORMAL_BUTTON.into(); - border_color.0 = config::BUTTON_BORDER_COLOR.into(); + border_color.0 = config::BUTTON_BORDER_COLOR; } } } diff --git a/src/game/mod.rs b/src/game/mod.rs index fca9aab..329c883 100644 --- a/src/game/mod.rs +++ b/src/game/mod.rs @@ -240,7 +240,8 @@ fn setup( fn timer_system(time: Res