From 4ebedf4dc82eb08c2cf3e20cb077d4238b71d929 Mon Sep 17 00:00:00 2001 From: Louis Dureuil Date: Wed, 30 Oct 2024 10:06:38 +0100 Subject: [PATCH] clippy fixes --- milli/src/update/new/extract/vectors/mod.rs | 3 +-- milli/src/update/new/indexer/de.rs | 2 +- milli/src/update/new/indexer/document_operation.rs | 2 +- milli/src/update/new/indexer/mod.rs | 7 +++---- 4 files changed, 6 insertions(+), 8 deletions(-) diff --git a/milli/src/update/new/extract/vectors/mod.rs b/milli/src/update/new/extract/vectors/mod.rs index 96b03a25b..facec10f6 100644 --- a/milli/src/update/new/extract/vectors/mod.rs +++ b/milli/src/update/new/extract/vectors/mod.rs @@ -358,8 +358,7 @@ impl<'a> Chunks<'a> { fn set_regenerate(&self, docid: DocumentId, regenerate: bool) { let mut user_provided = self.user_provided.borrow_mut(); - let user_provided = - user_provided.entry_ref(self.embedder_name).or_insert(Default::default()); + let user_provided = user_provided.entry_ref(self.embedder_name).or_default(); if regenerate { // regenerate == !user_provided user_provided.del.get_or_insert(Default::default()).insert(docid); diff --git a/milli/src/update/new/indexer/de.rs b/milli/src/update/new/indexer/de.rs index fa6b5fa76..3da4fc239 100644 --- a/milli/src/update/new/indexer/de.rs +++ b/milli/src/update/new/indexer/de.rs @@ -49,7 +49,7 @@ impl<'de, 'p, 'indexer: 'de, Mapper: MutFieldIdMapper> Visitor<'de> visitor: MutFieldIdMapVisitor(self.fields_ids_map), })? { - let Some(fid) = fid else { + let Some(_fid) = fid else { return Ok(Err(crate::UserError::AttributeLimitReached)); }; self.fields_ids_map = fields_ids_map; diff --git a/milli/src/update/new/indexer/document_operation.rs b/milli/src/update/new/indexer/document_operation.rs index bc1634d75..9ba74c69e 100644 --- a/milli/src/update/new/indexer/document_operation.rs +++ b/milli/src/update/new/indexer/document_operation.rs @@ -9,7 +9,7 @@ use IndexDocumentsMethod as Idm; use super::super::document_change::DocumentChange; use super::document_changes::{DocumentChangeContext, DocumentChanges, MostlySend}; use crate::documents::PrimaryKey; -use crate::update::new::document::{DocumentFromVersions, Versions}; +use crate::update::new::document::Versions; use crate::update::new::{Deletion, Insertion, Update}; use crate::update::{AvailableIds, IndexDocumentsMethod}; use crate::{DocumentId, Error, FieldsIdsMap, Index, Result, UserError}; diff --git a/milli/src/update/new/indexer/mod.rs b/milli/src/update/new/indexer/mod.rs index d0be88e34..7fba0ffa4 100644 --- a/milli/src/update/new/indexer/mod.rs +++ b/milli/src/update/new/indexer/mod.rs @@ -16,12 +16,11 @@ use itertools::{EitherOrBoth, Itertools}; pub use partial_dump::PartialDump; use rand::SeedableRng as _; use rayon::ThreadPool; -use roaring::RoaringBitmap; use time::OffsetDateTime; pub use update_by_function::UpdateByFunction; use super::channel::*; -use super::document::write_to_obkv; +use super::document::{write_to_obkv, Document}; use super::document_change::DocumentChange; use super::extract::*; use super::merger::{merge_grenad_entries, FacetFieldIdsDelta}; @@ -252,7 +251,7 @@ where } /// FIXME: need access to `merger_sender` let embedding_sender = todo!(); - let extractor = EmbeddingExtractor::new(&embedders, &embedding_sender, request_threads()); + let extractor = EmbeddingExtractor::new(embedders, &embedding_sender, request_threads()); let datastore = ThreadLocal::with_capacity(pool.current_num_threads()); for_each_document_change(document_changes, &extractor, indexing_context, &mut extractor_allocs, &datastore)?; @@ -324,7 +323,7 @@ where .inner_as_ref() .iter() .map(|(embedder_name, (embedder, _, was_quantized))| { - let embedder_index = index.embedder_category_id.get(wtxn, &embedder_name)?.ok_or( + let embedder_index = index.embedder_category_id.get(wtxn, embedder_name)?.ok_or( InternalError::DatabaseMissingEntry { db_name: "embedder_category_id", key: None,