From 71494264ca7303071cfeafbdbf137e11e653190f Mon Sep 17 00:00:00 2001 From: Adhyan Date: Mon, 2 Sep 2024 11:02:17 -0600 Subject: [PATCH] fixed clippy lints --- src/list/state.rs | 24 ++++-------------------- 1 file changed, 4 insertions(+), 20 deletions(-) diff --git a/src/list/state.rs b/src/list/state.rs index 8d5bf5b8..9e813a0f 100644 --- a/src/list/state.rs +++ b/src/list/state.rs @@ -352,26 +352,10 @@ impl<'a> ListState<'a> { .app_state .exercises() .iter() - .filter_map(|exercise| { - match self.filter() { - Filter::None => { - Some(exercise) - }, - Filter::Done => { - if exercise.done { - Some(exercise) - } else { - None - } - }, - Filter::Pending => { - if !exercise.done { - Some(exercise) - } else { - None - } - } - } + .filter(|exercise| match self.filter() { + Filter::None => true, + Filter::Done => exercise.done, + Filter::Pending => !exercise.done, }) .enumerate() .find_map(|(i, s)| {