From 2576c0c462c3a650201cd12d7d5e392e53a6f33a Mon Sep 17 00:00:00 2001 From: Tamo Date: Mon, 11 Sep 2023 17:15:57 +0200 Subject: [PATCH] fix clippy --- index-scheduler/src/batch.rs | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/index-scheduler/src/batch.rs b/index-scheduler/src/batch.rs index be3148508..fa4784bc5 100644 --- a/index-scheduler/src/batch.rs +++ b/index-scheduler/src/batch.rs @@ -1493,7 +1493,7 @@ fn delete_document_by_filter<'a>( ) -> Result { let filter = Filter::from_json(filter)?; Ok(if let Some(filter) = filter { - let candidates = filter.evaluate(&wtxn, &index).map_err(|err| match err { + let candidates = filter.evaluate(wtxn, index).map_err(|err| match err { milli::Error::UserError(milli::UserError::InvalidFilter(_)) => { Error::from(err).with_custom_error_code(Code::InvalidDocumentFilter) } @@ -1501,10 +1501,7 @@ fn delete_document_by_filter<'a>( })?; let mut delete_operation = DeleteDocuments::new(wtxn, index)?; delete_operation.delete_documents(&candidates); - - let deleted_documents = - delete_operation.execute().map(|result| result.deleted_documents)?; - deleted_documents + delete_operation.execute().map(|result| result.deleted_documents)? } else { 0 })