From cae8c8946764e80e6117634ac63d4e2aa625bf59 Mon Sep 17 00:00:00 2001 From: Louis Dureuil Date: Wed, 20 Nov 2024 14:03:52 +0100 Subject: [PATCH] "fix" last warnings --- crates/milli/src/update/new/facet_search_builder.rs | 2 +- crates/milli/src/update/new/indexer/document_operation.rs | 2 +- crates/milli/src/update/new/indexer/partial_dump.rs | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/crates/milli/src/update/new/facet_search_builder.rs b/crates/milli/src/update/new/facet_search_builder.rs index 39e04a589..1993c1d00 100644 --- a/crates/milli/src/update/new/facet_search_builder.rs +++ b/crates/milli/src/update/new/facet_search_builder.rs @@ -204,7 +204,7 @@ fn merge_btreesets( result.extend(add); } - /// TODO remove allocation + // TODO remove allocation let result = SerdeJson::bytes_encode(&result).map_err(heed::Error::Encoding)?.into_owned(); if Some(result.as_ref()) == current { Ok(Operation::Ignore) diff --git a/crates/milli/src/update/new/indexer/document_operation.rs b/crates/milli/src/update/new/indexer/document_operation.rs index 51a52cf8b..7be2c88f4 100644 --- a/crates/milli/src/update/new/indexer/document_operation.rs +++ b/crates/milli/src/update/new/indexer/document_operation.rs @@ -133,7 +133,6 @@ fn extract_addition_payload_changes<'r, 'pl: 'r>( ) -> Result>> { let mut new_docids_version_offsets = hashbrown::HashMap::<&str, PayloadOperations<'pl>>::new(); - /// TODO manage the error let mut previous_offset = 0; let mut iter = Deserializer::from_slice(payload).into_iter::<&RawValue>(); while let Some(doc) = iter.next().transpose().map_err(InternalError::SerdeJson)? { @@ -160,6 +159,7 @@ fn extract_addition_payload_changes<'r, 'pl: 'r>( primary_key.get_or_insert(pk) } else { + // primary key was retrieved in the first iteration or in a previous payload primary_key.as_ref().unwrap() }; diff --git a/crates/milli/src/update/new/indexer/partial_dump.rs b/crates/milli/src/update/new/indexer/partial_dump.rs index 8b5a8b650..2cc653813 100644 --- a/crates/milli/src/update/new/indexer/partial_dump.rs +++ b/crates/milli/src/update/new/indexer/partial_dump.rs @@ -26,8 +26,8 @@ impl PartialDump { concurrent_available_ids: &'index ConcurrentAvailableIds, primary_key: &'index PrimaryKey, ) -> PartialDumpChanges<'index, I> { - /// Note for future self: - /// - We recommend sending chunks of documents in this `PartialDumpIndexer` we therefore need to create a custom take_while_size method (that doesn't drop items). + // Note for future self: + // - We recommend sending chunks of documents in this `PartialDumpIndexer` we therefore need to create a custom take_while_size method (that doesn't drop items). PartialDumpChanges { iter: self.iter, concurrent_available_ids, primary_key } } }