From 446ffb88c7b67d61d41be084fa724f84fa055e22 Mon Sep 17 00:00:00 2001 From: Jannik <32144358+mozzieongit@users.noreply.github.com> Date: Fri, 24 Sep 2021 18:03:37 +0200 Subject: Resolve clippy warnings (#187) * refactor: nest or patterns * refactor: fix clippy lint names * refactor: remove unnecessary wraps * style: apply cargo fmt --- src/command/search.rs | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) (limited to 'src/command/search.rs') diff --git a/src/command/search.rs b/src/command/search.rs index d3807bca..00e11f52 100644 --- a/src/command/search.rs +++ b/src/command/search.rs @@ -31,7 +31,7 @@ struct State { } impl State { - #[allow(clippy::clippy::cast_sign_loss)] + #[allow(clippy::cast_sign_loss)] fn durations(&self) -> Vec<(String, String)> { self.results .iter() @@ -179,9 +179,7 @@ async fn key_handler( app: &mut State, ) -> Option { match input { - Key::Esc | Key::Ctrl('c') | Key::Ctrl('d') | Key::Ctrl('g') => { - return Some(String::from("")) - } + Key::Esc | Key::Ctrl('c' | 'd' | 'g') => return Some(String::from("")), Key::Char('\n') => { let i = app.results_state.selected().unwrap_or(0); @@ -241,7 +239,7 @@ async fn key_handler( None } -#[allow(clippy::clippy::cast_possible_truncation)] +#[allow(clippy::cast_possible_truncation)] fn draw(f: &mut Frame<'_, T>, history_count: i64, app: &mut State) { let chunks = Layout::default() .direction(Direction::Vertical) @@ -312,7 +310,7 @@ fn draw(f: &mut Frame<'_, T>, history_count: i64, app: &mut State) { // this is a big blob of horrible! clean it up! // for now, it works. But it'd be great if it were more easily readable, and // modular. I'd like to add some more stats and stuff at some point -#[allow(clippy::clippy::cast_possible_truncation)] +#[allow(clippy::cast_possible_truncation)] async fn select_history( query: &[String], search_mode: SearchMode, @@ -350,7 +348,7 @@ async fn select_history( // This is supposed to more-or-less mirror the command line version, so ofc // it is going to have a lot of args -#[allow(clippy::clippy::clippy::too_many_arguments)] +#[allow(clippy::too_many_arguments)] pub async fn run( settings: &Settings, cwd: Option, -- cgit v1.3.1