diff --git a/milli/src/index.rs b/milli/src/index.rs index 8b1e4d8ff..5910a305c 100644 --- a/milli/src/index.rs +++ b/milli/src/index.rs @@ -1234,7 +1234,7 @@ pub(crate) mod tests { { let builder = IndexDocuments::new( wtxn, - &self, + self, &self.indexer_config, self.index_documents_config.clone(), |_| (), diff --git a/milli/src/search/criteria/mod.rs b/milli/src/search/criteria/mod.rs index 1b46c8441..ab1823779 100644 --- a/milli/src/search/criteria/mod.rs +++ b/milli/src/search/criteria/mod.rs @@ -610,7 +610,11 @@ fn query_pair_proximity_docids( } (QueryKind::Exact { word: left, .. }, QueryKind::Tolerant { typo, word: right }) => { let r_words = word_derivations(right, prefix, *typo, ctx.words_fst(), wdcache)?; +<<<<<<< HEAD all_word_pair_overall_proximity_docids(ctx, &[(left, 0)], r_words, proximity) +======= + all_word_pair_proximity_docids(ctx, &[(left, 0)], r_words, proximity) +>>>>>>> 08fe530b (Execute cargo clippy --fix) } ( QueryKind::Tolerant { typo: l_typo, word: left }, @@ -866,7 +870,7 @@ pub mod test { let mut keys = word_docids.keys().collect::>(); keys.sort_unstable(); - let words_fst = fst::Set::from_iter(keys).unwrap().map_data(|v| Cow::Owned(v)).unwrap(); + let words_fst = fst::Set::from_iter(keys).unwrap().map_data(Cow::Owned).unwrap(); TestContext { words_fst, diff --git a/milli/src/search/distinct/mod.rs b/milli/src/search/distinct/mod.rs index b6ed26917..3a46bb469 100644 --- a/milli/src/search/distinct/mod.rs +++ b/milli/src/search/distinct/mod.rs @@ -110,7 +110,7 @@ mod test { addition.execute().unwrap(); let fields_map = index.fields_ids_map(&txn).unwrap(); - let fid = fields_map.id(&distinct).unwrap(); + let fid = fields_map.id(distinct).unwrap(); let documents = DocumentsBatchReader::from_reader(Cursor::new(JSON.as_slice())).unwrap(); let map = (0..documents.documents_count() as u32).collect(); @@ -133,7 +133,7 @@ mod test { let s = value.to_string(); assert!(seen.insert(s)); } - Value::Array(values) => values.into_iter().for_each(|value| test(seen, value)), + Value::Array(values) => values.iter().for_each(|value| test(seen, value)), } } diff --git a/milli/src/snapshot_tests.rs b/milli/src/snapshot_tests.rs index bcb9805ea..d3fbfc285 100644 --- a/milli/src/snapshot_tests.rs +++ b/milli/src/snapshot_tests.rs @@ -314,8 +314,8 @@ pub fn snap_field_id_docid_facet_strings(index: &Index) -> String { pub fn snap_documents_ids(index: &Index) -> String { let rtxn = index.read_txn().unwrap(); let documents_ids = index.documents_ids(&rtxn).unwrap(); - let snap = display_bitmap(&documents_ids); - snap + + display_bitmap(&documents_ids) } pub fn snap_stop_words(index: &Index) -> String { let rtxn = index.read_txn().unwrap(); @@ -326,8 +326,8 @@ pub fn snap_stop_words(index: &Index) -> String { pub fn snap_soft_deleted_documents_ids(index: &Index) -> String { let rtxn = index.read_txn().unwrap(); let soft_deleted_documents_ids = index.soft_deleted_documents_ids(&rtxn).unwrap(); - let soft_deleted_documents_ids = display_bitmap(&soft_deleted_documents_ids); - soft_deleted_documents_ids + + display_bitmap(&soft_deleted_documents_ids) } pub fn snap_field_distributions(index: &Index) -> String { let rtxn = index.read_txn().unwrap(); @@ -350,8 +350,8 @@ pub fn snap_fields_ids_map(index: &Index) -> String { pub fn snap_geo_faceted_documents_ids(index: &Index) -> String { let rtxn = index.read_txn().unwrap(); let geo_faceted_documents_ids = index.geo_faceted_documents_ids(&rtxn).unwrap(); - let snap = display_bitmap(&geo_faceted_documents_ids); - snap + + display_bitmap(&geo_faceted_documents_ids) } pub fn snap_external_documents_ids(index: &Index) -> String { let rtxn = index.read_txn().unwrap(); diff --git a/milli/src/update/delete_documents.rs b/milli/src/update/delete_documents.rs index f1341c48c..1dd3f423b 100644 --- a/milli/src/update/delete_documents.rs +++ b/milli/src/update/delete_documents.rs @@ -641,7 +641,7 @@ mod tests { external_ids: &[&str], disable_soft_deletion: bool, ) -> Vec { - let external_document_ids = index.external_documents_ids(&wtxn).unwrap(); + let external_document_ids = index.external_documents_ids(wtxn).unwrap(); let ids_to_delete: Vec = external_ids .iter() .map(|id| external_document_ids.get(id.as_bytes()).unwrap()) @@ -858,7 +858,7 @@ mod tests { assert!(!results.documents_ids.is_empty()); for id in results.documents_ids.iter() { assert!( - !deleted_internal_ids.contains(&id), + !deleted_internal_ids.contains(id), "The document {} was supposed to be deleted", id ); @@ -922,7 +922,7 @@ mod tests { assert!(!results.documents_ids.is_empty()); for id in results.documents_ids.iter() { assert!( - !deleted_internal_ids.contains(&id), + !deleted_internal_ids.contains(id), "The document {} was supposed to be deleted", id ); @@ -986,7 +986,7 @@ mod tests { assert!(!results.documents_ids.is_empty()); for id in results.documents_ids.iter() { assert!( - !deleted_internal_ids.contains(&id), + !deleted_internal_ids.contains(id), "The document {} was supposed to be deleted", id ); diff --git a/milli/src/update/index_documents/mod.rs b/milli/src/update/index_documents/mod.rs index a121d3ae0..468a8c56f 100644 --- a/milli/src/update/index_documents/mod.rs +++ b/milli/src/update/index_documents/mod.rs @@ -772,7 +772,7 @@ mod tests { let docs = index.documents(&rtxn, vec![0, 1, 2]).unwrap(); let (_id, obkv) = docs.iter().find(|(_id, kv)| kv.get(0) == Some(br#""kevin""#)).unwrap(); - let kevin_uuid: String = serde_json::from_slice(&obkv.get(1).unwrap()).unwrap(); + let kevin_uuid: String = serde_json::from_slice(obkv.get(1).unwrap()).unwrap(); drop(rtxn); // Second we send 1 document with the generated uuid, to erase the previous ones. @@ -1811,7 +1811,7 @@ mod tests { let long_word = "lol".repeat(1000); let doc1 = documents! {[{ "id": "1", - "title": long_word.clone(), + "title": long_word, }]}; index.add_documents(doc1).unwrap(); diff --git a/milli/src/update/prefix_word_pairs/word_prefix.rs b/milli/src/update/prefix_word_pairs/word_prefix.rs index 53e421fac..62d4d4c03 100644 --- a/milli/src/update/prefix_word_pairs/word_prefix.rs +++ b/milli/src/update/prefix_word_pairs/word_prefix.rs @@ -574,7 +574,7 @@ mod tests { expected_prefixes: &[&str], ) { let mut actual_prefixes = vec![]; - trie.for_each_prefix_of(word.as_bytes(), &mut Vec::new(), &search_start, |x| { + trie.for_each_prefix_of(word.as_bytes(), &mut Vec::new(), search_start, |x| { let s = String::from_utf8(x.to_owned()).unwrap(); actual_prefixes.push(s); }); diff --git a/milli/tests/search/mod.rs b/milli/tests/search/mod.rs index c8b01648c..d5e321158 100644 --- a/milli/tests/search/mod.rs +++ b/milli/tests/search/mod.rs @@ -19,7 +19,7 @@ mod query_criteria; mod sort; mod typo_tolerance; -pub const TEST_QUERY: &'static str = "hello world america"; +pub const TEST_QUERY: &str = "hello world america"; pub const EXTERNAL_DOCUMENTS_IDS: &[&str; 17] = &["A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q"]; @@ -177,7 +177,7 @@ fn execute_filter(filter: &str, document: &TestDocument) -> Option { { id = Some(document.id.clone()) } - } else if let Some((field, filter)) = filter.split_once("=") { + } else if let Some((field, filter)) = filter.split_once('=') { if field == "tag" && document.tag == filter { id = Some(document.id.clone()) } else if field == "asc_desc_rank" @@ -185,11 +185,11 @@ fn execute_filter(filter: &str, document: &TestDocument) -> Option { { id = Some(document.id.clone()) } - } else if let Some(("asc_desc_rank", filter)) = filter.split_once("<") { + } else if let Some(("asc_desc_rank", filter)) = filter.split_once('<') { if document.asc_desc_rank < filter.parse().unwrap() { id = Some(document.id.clone()) } - } else if let Some(("asc_desc_rank", filter)) = filter.split_once(">") { + } else if let Some(("asc_desc_rank", filter)) = filter.split_once('>') { if document.asc_desc_rank > filter.parse().unwrap() { id = Some(document.id.clone()) } diff --git a/milli/tests/search/query_criteria.rs b/milli/tests/search/query_criteria.rs index 90b4d6362..3007a83ea 100644 --- a/milli/tests/search/query_criteria.rs +++ b/milli/tests/search/query_criteria.rs @@ -200,14 +200,12 @@ test_criterion!( #[test] fn criteria_mixup() { use Criterion::*; - let index = search::setup_search_index_with_criteria(&vec![ - Words, + let index = search::setup_search_index_with_criteria(&[Words, Attribute, Desc(S("asc_desc_rank")), Exactness, Proximity, - Typo, - ]); + Typo]); #[rustfmt::skip] let criteria_mix = {