From b7ad05073790d3d11aaedc3354f6f68baf185eaa Mon Sep 17 00:00:00 2001 From: Kerollmops Date: Wed, 5 Oct 2022 13:46:45 +0200 Subject: [PATCH] Panic if we encountered a wring KindWithContent type --- index-scheduler/src/batch.rs | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/index-scheduler/src/batch.rs b/index-scheduler/src/batch.rs index a8179ac5c..c2e9c74f8 100644 --- a/index-scheduler/src/batch.rs +++ b/index-scheduler/src/batch.rs @@ -136,14 +136,16 @@ impl IndexScheduler { let mut documents_counts = Vec::new(); let mut content_files = Vec::new(); for task in &tasks { - if let KindWithContent::DocumentImport { - content_file, - documents_count, - .. - } = task.kind - { - documents_counts.push(documents_count); - content_files.push(content_file); + match task.kind { + KindWithContent::DocumentImport { + content_file, + documents_count, + .. + } => { + documents_counts.push(documents_count); + content_files.push(content_file); + } + _ => unreachable!(), } }