From 07d39776f9d58d55483257c6b7ea9a6eafc96c3a Mon Sep 17 00:00:00 2001 From: Irevoire Date: Wed, 26 Oct 2022 18:03:48 +0200 Subject: [PATCH] fix clippy _once again_ --- index-scheduler/src/index_mapper.rs | 2 +- index-scheduler/src/utils.rs | 14 ++++++-------- 2 files changed, 7 insertions(+), 9 deletions(-) diff --git a/index-scheduler/src/index_mapper.rs b/index-scheduler/src/index_mapper.rs index 277fe9d7c..80e4127c0 100644 --- a/index-scheduler/src/index_mapper.rs +++ b/index-scheduler/src/index_mapper.rs @@ -75,7 +75,7 @@ impl IndexMapper { /// Get or create the index. pub fn create_index(&self, mut wtxn: RwTxn, name: &str) -> Result { - match self.index(&mut wtxn, name) { + match self.index(&wtxn, name) { Ok(index) => { wtxn.commit()?; Ok(index) diff --git a/index-scheduler/src/utils.rs b/index-scheduler/src/utils.rs index 992e60fbb..04010540a 100644 --- a/index-scheduler/src/utils.rs +++ b/index-scheduler/src/utils.rs @@ -287,14 +287,12 @@ pub(crate) fn filter_out_references_to_newer_tasks(task: &mut Task) { } _ => return, }; - match &mut task.details { - Some( - Details::TaskCancelation { matched_tasks, .. } - | Details::TaskDeletion { matched_tasks, .. }, - ) => { - *matched_tasks = new_nbr_of_matched_tasks; - } - _ => (), + if let Some( + Details::TaskCancelation { matched_tasks, .. } + | Details::TaskDeletion { matched_tasks, .. }, + ) = &mut task.details + { + *matched_tasks = new_nbr_of_matched_tasks; } }