fix clippy from the CI

This commit is contained in:
Irevoire 2022-10-26 18:27:43 +02:00 committed by Clément Renault
parent 953055e3d7
commit 33996071ea
No known key found for this signature in database
GPG Key ID: 92ADA4E935E71FA4

View File

@ -363,12 +363,11 @@ impl IndexScheduler {
} }
match details { match details {
Some(details) => match details { Some(details) => match details {
Details::IndexSwap { swaps: sw1 } => match &kind { Details::IndexSwap { swaps: sw1 } => {
KindWithContent::IndexSwap { swaps: sw2 } => { if let KindWithContent::IndexSwap { swaps: sw2 } = &kind {
assert_eq!(&sw1, sw2); assert_eq!(&sw1, sw2);
} }
_ => panic!(), }
},
Details::DocumentAdditionOrUpdate { received_documents, indexed_documents } => { Details::DocumentAdditionOrUpdate { received_documents, indexed_documents } => {
assert_eq!(kind.as_kind(), Kind::DocumentAdditionOrUpdate); assert_eq!(kind.as_kind(), Kind::DocumentAdditionOrUpdate);
if let Some(indexed_documents) = indexed_documents { 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_status(&rtxn, status).unwrap().contains(uid));
assert!(self.get_kind(&rtxn, kind.as_kind()).unwrap().contains(uid)); assert!(self.get_kind(&rtxn, kind.as_kind()).unwrap().contains(uid));
match kind { if let KindWithContent::DocumentAdditionOrUpdate { content_file, .. } = kind {
KindWithContent::DocumentAdditionOrUpdate { content_file, .. } => match status { match status {
Status::Enqueued | Status::Processing => { Status::Enqueued | Status::Processing => {
assert!(self.file_store.__all_uuids().contains(&content_file)); assert!(self.file_store.__all_uuids().contains(&content_file));
} }
Status::Succeeded | Status::Failed | Status::Canceled => { Status::Succeeded | Status::Failed | Status::Canceled => {
assert!(!self.file_store.__all_uuids().contains(&content_file)); assert!(!self.file_store.__all_uuids().contains(&content_file));
} }
}, }
_ => (),
} }
} }
} }