diff --git a/crates/index-scheduler/src/lib.rs b/crates/index-scheduler/src/lib.rs index b493b50cd..ac51e584a 100644 --- a/crates/index-scheduler/src/lib.rs +++ b/crates/index-scheduler/src/lib.rs @@ -2016,10 +2016,7 @@ impl<'a> Dump<'a> { task: TaskDump, content_file: Option>, ) -> Result { - let task_has_no_docs = match task.kind { - KindDump::DocumentImport { documents_count, .. } if documents_count == 0 => true, - _ => false, - }; + let task_has_no_docs = matches!(task.kind, KindDump::DocumentImport { documents_count, .. } if documents_count == 0); let content_uuid = match content_file { Some(content_file) if task.status == Status::Enqueued => { @@ -2040,9 +2037,7 @@ impl<'a> Dump<'a> { // in case we try to open it later. _ if task.status != Status::Enqueued => Some(Uuid::nil()), None if task.status == Status::Enqueued && task_has_no_docs => { - let (uuid, mut file) = self.index_scheduler.create_update_file(false)?; - let builder = DocumentsBatchBuilder::new(&mut file); - builder.into_inner()?; + let (uuid, file) = self.index_scheduler.create_update_file(false)?; file.persist()?; Some(uuid)