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; - }; + } } }