From 935703e1abbbc0934de428948c5b86663dcb67d8 Mon Sep 17 00:00:00 2001 From: futile Date: Sun, 20 Apr 2025 06:19:29 +0100 Subject: [PATCH] listen to a few clippy lints --- src/features/force_close.rs | 8 +++----- src/features/game_networking.rs | 13 +++++++------ 2 files changed, 10 insertions(+), 11 deletions(-) diff --git a/src/features/force_close.rs b/src/features/force_close.rs index 68e3029..7cb5b1b 100644 --- a/src/features/force_close.rs +++ b/src/features/force_close.rs @@ -33,11 +33,9 @@ impl ForceClose { } if self.counting && self.timer.elapsed() >= INTERVAL { self.reset(); - } else { - if force_close_button_clicked && !self.current_frame { - activate(sysinfo); - self.reset(); - } + } else if force_close_button_clicked && !self.current_frame { + activate(sysinfo); + self.reset(); } self.finish_current_frame(); } diff --git a/src/features/game_networking.rs b/src/features/game_networking.rs index 79978c8..94f5a84 100644 --- a/src/features/game_networking.rs +++ b/src/features/game_networking.rs @@ -36,9 +36,10 @@ pub enum BlockedStatus { impl From for BlockedStatus { fn from(value: bool) -> Self { - match value { - true => Self::Blocked, - false => Self::Unblocked, + if value { + Self::Blocked + } else { + Self::Unblocked } } } @@ -54,8 +55,8 @@ impl From for eframe::egui::Color32 { } impl BlockedStatus { - pub fn to_color32(&self) -> eframe::egui::Color32 { - (*self).into() + pub fn to_color32(self) -> eframe::egui::Color32 { + self.into() } } @@ -172,7 +173,7 @@ impl GameNetworking { { self.counting = false; self.blocked_status = BlockedStatus::Unblocked; - }; + } } }