From 33996071ea65fd2e536da8650aef07a8c011d5b5 Mon Sep 17 00:00:00 2001 From: Irevoire Date: Wed, 26 Oct 2022 18:27:43 +0200 Subject: [PATCH] fix clippy from the CI --- index-scheduler/src/utils.rs | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/index-scheduler/src/utils.rs b/index-scheduler/src/utils.rs index 04010540a..b057fee23 100644 --- a/index-scheduler/src/utils.rs +++ b/index-scheduler/src/utils.rs @@ -363,12 +363,11 @@ impl IndexScheduler { } match details { Some(details) => match details { - Details::IndexSwap { swaps: sw1 } => match &kind { - KindWithContent::IndexSwap { swaps: sw2 } => { + Details::IndexSwap { swaps: sw1 } => { + if let KindWithContent::IndexSwap { swaps: sw2 } = &kind { assert_eq!(&sw1, sw2); } - _ => panic!(), - }, + } Details::DocumentAdditionOrUpdate { received_documents, indexed_documents } => { assert_eq!(kind.as_kind(), Kind::DocumentAdditionOrUpdate); if let Some(indexed_documents) = indexed_documents { @@ -466,16 +465,15 @@ impl IndexScheduler { assert!(self.get_status(&rtxn, status).unwrap().contains(uid)); assert!(self.get_kind(&rtxn, kind.as_kind()).unwrap().contains(uid)); - match kind { - KindWithContent::DocumentAdditionOrUpdate { content_file, .. } => match status { + if let KindWithContent::DocumentAdditionOrUpdate { content_file, .. } = kind { + match status { Status::Enqueued | Status::Processing => { assert!(self.file_store.__all_uuids().contains(&content_file)); } Status::Succeeded | Status::Failed | Status::Canceled => { assert!(!self.file_store.__all_uuids().contains(&content_file)); } - }, - _ => (), + } } } }