diff --git a/milli/src/external_documents_ids.rs b/milli/src/external_documents_ids.rs index 2c63087f0..f47df0762 100644 --- a/milli/src/external_documents_ids.rs +++ b/milli/src/external_documents_ids.rs @@ -28,7 +28,11 @@ impl ExternalDocumentsIds { self.0.is_empty(rtxn).map_err(Into::into) } - pub fn get>(&self, rtxn: &RoTxn<'_>, external_id: A) -> heed::Result> { + pub fn get>( + &self, + rtxn: &RoTxn<'_>, + external_id: A, + ) -> heed::Result> { self.0.get(rtxn, external_id.as_ref()) } @@ -51,7 +55,11 @@ impl ExternalDocumentsIds { /// /// - If attempting to delete a document that doesn't exist /// - If attempting to create a document that already exists - pub fn apply(&self, wtxn: &mut RwTxn<'_>, operations: Vec) -> heed::Result<()> { + pub fn apply( + &self, + wtxn: &mut RwTxn<'_>, + operations: Vec, + ) -> heed::Result<()> { for DocumentOperation { external_id, internal_id, kind } in operations { match kind { DocumentOperationKind::Create => { diff --git a/milli/src/index.rs b/milli/src/index.rs index d9fc07b54..bd194d95d 100644 --- a/milli/src/index.rs +++ b/milli/src/index.rs @@ -375,7 +375,11 @@ impl Index { /* primary key */ /// Writes the documents primary key, this is the field name that is used to store the id. - pub(crate) fn put_primary_key(&self, wtxn: &mut RwTxn<'_>, primary_key: &str) -> heed::Result<()> { + pub(crate) fn put_primary_key( + &self, + wtxn: &mut RwTxn<'_>, + primary_key: &str, + ) -> heed::Result<()> { self.set_updated_at(wtxn, &OffsetDateTime::now_utc())?; self.main.remap_types::().put(wtxn, main_key::PRIMARY_KEY_KEY, primary_key) } @@ -531,7 +535,10 @@ impl Index { } /// Delete the documents ids that are faceted with a _geo field. - pub(crate) fn delete_geo_faceted_documents_ids(&self, wtxn: &mut RwTxn<'_>) -> heed::Result { + pub(crate) fn delete_geo_faceted_documents_ids( + &self, + wtxn: &mut RwTxn<'_>, + ) -> heed::Result { self.main.remap_key_type::().delete(wtxn, main_key::GEO_FACETED_DOCUMENTS_IDS_KEY) } @@ -763,7 +770,10 @@ impl Index { } /// Identical to `user_defined_searchable_fields`, but returns ids instead. - pub fn user_defined_searchable_fields_ids(&self, rtxn: &RoTxn<'_>) -> Result>> { + pub fn user_defined_searchable_fields_ids( + &self, + rtxn: &RoTxn<'_>, + ) -> Result>> { match self.user_defined_searchable_fields(rtxn)? { Some(fields) => { let fields_ids_map = self.fields_ids_map(rtxn)?; @@ -1198,7 +1208,10 @@ impl Index { .unwrap_or_default()) } - pub fn synonyms(&self, rtxn: &RoTxn<'_>) -> heed::Result, Vec>>> { + pub fn synonyms( + &self, + rtxn: &RoTxn<'_>, + ) -> heed::Result, Vec>>> { Ok(self .main .remap_types::>() @@ -1384,7 +1397,11 @@ impl Index { .unwrap_or(DEFAULT_MIN_WORD_LEN_ONE_TYPO)) } - pub(crate) fn put_min_word_len_one_typo(&self, txn: &mut RwTxn<'_>, val: u8) -> heed::Result<()> { + pub(crate) fn put_min_word_len_one_typo( + &self, + txn: &mut RwTxn<'_>, + val: u8, + ) -> heed::Result<()> { // It is not possible to put a bool in heed with OwnedType, so we put a u8 instead. We // identify 0 as being false, and anything else as true. The absence of a value is true, // because by default, we authorize typos. @@ -1403,7 +1420,11 @@ impl Index { .unwrap_or(DEFAULT_MIN_WORD_LEN_TWO_TYPOS)) } - pub(crate) fn put_min_word_len_two_typos(&self, txn: &mut RwTxn<'_>, val: u8) -> heed::Result<()> { + pub(crate) fn put_min_word_len_two_typos( + &self, + txn: &mut RwTxn<'_>, + val: u8, + ) -> heed::Result<()> { // It is not possible to put a bool in heed with OwnedType, so we put a u8 instead. We // identify 0 as being false, and anything else as true. The absence of a value is true, // because by default, we authorize typos. @@ -1467,7 +1488,11 @@ impl Index { self.main.remap_types::().get(txn, main_key::MAX_VALUES_PER_FACET) } - pub(crate) fn put_max_values_per_facet(&self, txn: &mut RwTxn<'_>, val: u64) -> heed::Result<()> { + pub(crate) fn put_max_values_per_facet( + &self, + txn: &mut RwTxn<'_>, + val: u64, + ) -> heed::Result<()> { self.main.remap_types::().put(txn, main_key::MAX_VALUES_PER_FACET, &val) } @@ -1508,7 +1533,10 @@ impl Index { self.main.remap_types::().put(txn, main_key::PAGINATION_MAX_TOTAL_HITS, &val) } - pub(crate) fn delete_pagination_max_total_hits(&self, txn: &mut RwTxn<'_>) -> heed::Result { + pub(crate) fn delete_pagination_max_total_hits( + &self, + txn: &mut RwTxn<'_>, + ) -> heed::Result { self.main.remap_key_type::().delete(txn, main_key::PAGINATION_MAX_TOTAL_HITS) } @@ -1544,7 +1572,10 @@ impl Index { self.script_language_docids.get(rtxn, key) } - pub fn script_language(&self, rtxn: &RoTxn<'_>) -> heed::Result>> { + pub fn script_language( + &self, + rtxn: &RoTxn<'_>, + ) -> heed::Result>> { let mut script_language: HashMap> = HashMap::new(); let mut script_language_doc_count: Vec<(Script, Language, u64)> = Vec::new(); let mut total = 0; diff --git a/milli/src/lib.rs b/milli/src/lib.rs index adce740a8..581ffc73c 100644 --- a/milli/src/lib.rs +++ b/milli/src/lib.rs @@ -229,7 +229,10 @@ pub fn obkv_to_json( } /// Transform every field of a raw obkv store into a JSON Object. -pub fn all_obkv_to_json(obkv: obkv::KvReaderU16<'_>, fields_ids_map: &FieldsIdsMap) -> Result { +pub fn all_obkv_to_json( + obkv: obkv::KvReaderU16<'_>, + fields_ids_map: &FieldsIdsMap, +) -> Result { let all_keys = obkv.iter().map(|(k, _v)| k).collect::>(); obkv_to_json(all_keys.as_slice(), fields_ids_map, obkv) } diff --git a/milli/src/search/new/logger/visual.rs b/milli/src/search/new/logger/visual.rs index 5b5a29b65..62c2d6798 100644 --- a/milli/src/search/new/logger/visual.rs +++ b/milli/src/search/new/logger/visual.rs @@ -97,7 +97,7 @@ impl SearchLogger for VisualSearchLogger { fn next_bucket_ranking_rule( &mut self, ranking_rule_idx: usize, - _ranking_rule: &dyn RankingRule<'_,QueryGraph>, + _ranking_rule: &dyn RankingRule<'_, QueryGraph>, universe: &RoaringBitmap, bucket: &RoaringBitmap, ) { diff --git a/milli/src/search/new/matches/mod.rs b/milli/src/search/new/matches/mod.rs index a0cfdaa65..f387e232b 100644 --- a/milli/src/search/new/matches/mod.rs +++ b/milli/src/search/new/matches/mod.rs @@ -244,7 +244,12 @@ impl<'t> Matcher<'t, '_> { } /// Returns the bounds in byte index of the crop window. - fn crop_bounds(&self, tokens: &[Token<'_>], matches: &[Match], crop_size: usize) -> (usize, usize) { + fn crop_bounds( + &self, + tokens: &[Token<'_>], + matches: &[Match], + crop_size: usize, + ) -> (usize, usize) { // if there is no match, we start from the beginning of the string by default. let first_match_word_position = matches.first().map(|m| m.word_position).unwrap_or(0); let first_match_token_position = matches.first().map(|m| m.token_position).unwrap_or(0); diff --git a/milli/src/search/new/mod.rs b/milli/src/search/new/mod.rs index 2d0d63e0e..208e1b428 100644 --- a/milli/src/search/new/mod.rs +++ b/milli/src/search/new/mod.rs @@ -775,7 +775,10 @@ pub fn execute_search( }) } -fn check_sort_criteria(ctx: &SearchContext<'_>, sort_criteria: Option<&Vec>) -> Result<()> { +fn check_sort_criteria( + ctx: &SearchContext<'_>, + sort_criteria: Option<&Vec>, +) -> Result<()> { let sort_criteria = if let Some(sort_criteria) = sort_criteria { sort_criteria } else { diff --git a/milli/src/search/new/query_term/parse_query.rs b/milli/src/search/new/query_term/parse_query.rs index d7c279a27..d4c1c2f95 100644 --- a/milli/src/search/new/query_term/parse_query.rs +++ b/milli/src/search/new/query_term/parse_query.rs @@ -297,7 +297,12 @@ impl PhraseBuilder { } // precondition: token has kind Word or StopWord - fn push_word(&mut self, ctx: &mut SearchContext<'_>, token: &charabia::Token<'_>, position: u16) { + fn push_word( + &mut self, + ctx: &mut SearchContext<'_>, + token: &charabia::Token<'_>, + position: u16, + ) { if self.is_empty() { self.start = position; } diff --git a/milli/src/update/index_documents/extract/extract_geo_points.rs b/milli/src/update/index_documents/extract/extract_geo_points.rs index 2c54df74b..ac8b7abee 100644 --- a/milli/src/update/index_documents/extract/extract_geo_points.rs +++ b/milli/src/update/index_documents/extract/extract_geo_points.rs @@ -68,7 +68,7 @@ pub fn extract_geo_points( /// Extract the finite floats lat and lng from two bytes slices. fn extract_lat_lng( - document: &obkv::KvReader<'_,FieldId>, + document: &obkv::KvReader<'_, FieldId>, settings: &InnerIndexSettings, deladd: DelAdd, document_id: impl Fn() -> Value, diff --git a/milli/src/update/settings.rs b/milli/src/update/settings.rs index eea7e90b8..3ad6e658c 100644 --- a/milli/src/update/settings.rs +++ b/milli/src/update/settings.rs @@ -1422,7 +1422,11 @@ impl InnerIndexSettings { } // find and insert the new field ids - pub fn recompute_searchables(&mut self, wtxn: &mut heed::RwTxn<'_>, index: &Index) -> Result<()> { + pub fn recompute_searchables( + &mut self, + wtxn: &mut heed::RwTxn<'_>, + index: &Index, + ) -> Result<()> { let searchable_fields = self .user_defined_searchable_fields .as_ref()