From 611f70c4fecb11751ab9ef71f443f05e46ce4b46 Mon Sep 17 00:00:00 2001 From: FujiApple Date: Fri, 29 Nov 2024 22:56:13 +0800 Subject: [PATCH] chore: fix clippy lints from Rust nightly --- crates/trippy-core/src/strategy.rs | 4 +--- crates/trippy-tui/src/frontend/binding.rs | 4 +--- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/crates/trippy-core/src/strategy.rs b/crates/trippy-core/src/strategy.rs index 4499628bf..02db8cb24 100644 --- a/crates/trippy-core/src/strategy.rs +++ b/crates/trippy-core/src/strategy.rs @@ -1596,7 +1596,5 @@ mod state { /// Returns true if the duration between start and end is grater than a duration, false otherwise. fn exceeds(start: Option, end: SystemTime, dur: Duration) -> bool { - start.map_or(false, |start| { - end.duration_since(start).unwrap_or_default() > dur - }) + start.is_some_and(|start| end.duration_since(start).unwrap_or_default() > dur) } diff --git a/crates/trippy-tui/src/frontend/binding.rs b/crates/trippy-tui/src/frontend/binding.rs index f74aea421..ee0cbfad4 100644 --- a/crates/trippy-tui/src/frontend/binding.rs +++ b/crates/trippy-tui/src/frontend/binding.rs @@ -101,9 +101,7 @@ pub struct KeyBinding { impl KeyBinding { pub fn check(&self, event: KeyEvent) -> bool { let code_match = match (event.code, self.code) { - (KeyCode::Char(c1), KeyCode::Char(c2)) => { - c1.to_ascii_lowercase() == c2.to_ascii_lowercase() - } + (KeyCode::Char(c1), KeyCode::Char(c2)) => c1.eq_ignore_ascii_case(&c2), (c1, c2) => c1 == c2, }; code_match && self.modifiers == event.modifiers