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,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!(),
}
}