Panic if we encountered a wring KindWithContent type

This commit is contained in:
Kerollmops 2022-10-05 13:46:45 +02:00 committed by Clément Renault
parent 36e5efde0d
commit 6b3b05fb73
No known key found for this signature in database
GPG Key ID: 92ADA4E935E71FA4

View File

@ -136,15 +136,17 @@ impl IndexScheduler {
let mut documents_counts = Vec::new(); let mut documents_counts = Vec::new();
let mut content_files = Vec::new(); let mut content_files = Vec::new();
for task in &tasks { for task in &tasks {
if let KindWithContent::DocumentImport { match task.kind {
KindWithContent::DocumentImport {
content_file, content_file,
documents_count, documents_count,
.. ..
} = task.kind } => {
{
documents_counts.push(documents_count); documents_counts.push(documents_count);
content_files.push(content_file); content_files.push(content_file);
} }
_ => unreachable!(),
}
} }
Ok(Some(Batch::IndexOperation( Ok(Some(Batch::IndexOperation(