diff --git a/milli/src/search/mod.rs b/milli/src/search/mod.rs index 46829b986..95a83e121 100644 --- a/milli/src/search/mod.rs +++ b/milli/src/search/mod.rs @@ -109,7 +109,8 @@ impl<'a> Search<'a> { self } - fn is_typo_authorized(&self) -> Result { + // TODO! + fn _is_typo_authorized(&self) -> Result { let index_authorizes_typos = self.index.authorize_typos(self.rtxn)?; // only authorize typos if both the index and the query allow it. Ok(self.authorize_typos && index_authorizes_typos) diff --git a/milli/src/update/facet/incremental.rs b/milli/src/update/facet/incremental.rs index aaef93b48..a921d4115 100644 --- a/milli/src/update/facet/incremental.rs +++ b/milli/src/update/facet/incremental.rs @@ -699,21 +699,21 @@ mod tests { #[test] fn many_field_ids_prepend() { let index = FacetIndex::::new(4, 8, 5); - for i in (0..256).into_iter().rev() { + for i in (0..256).rev() { let mut bitmap = RoaringBitmap::new(); bitmap.insert(i as u32); let mut txn = index.env.write_txn().unwrap(); index.insert(&mut txn, 0, &(i as f64), &bitmap); txn.commit().unwrap(); } - for i in (0..256).into_iter().rev() { + for i in (0..256).rev() { let mut bitmap = RoaringBitmap::new(); bitmap.insert(i as u32); let mut txn = index.env.write_txn().unwrap(); index.insert(&mut txn, 2, &(i as f64), &bitmap); txn.commit().unwrap(); } - for i in (0..256).into_iter().rev() { + for i in (0..256).rev() { let mut bitmap = RoaringBitmap::new(); bitmap.insert(i as u32); let mut txn = index.env.write_txn().unwrap(); @@ -733,7 +733,7 @@ mod tests { let index = FacetIndex::::new(4, 8, 5); let mut txn = index.env.write_txn().unwrap(); - for i in (0..256).into_iter().rev() { + for i in (0..256).rev() { let mut bitmap = RoaringBitmap::new(); bitmap.insert(i); index.insert(&mut txn, 0, &(i as f64), &bitmap); @@ -749,7 +749,7 @@ mod tests { let index = FacetIndex::::new(4, 8, 5); let mut txn = index.env.write_txn().unwrap(); - let mut keys = (0..256).into_iter().collect::>(); + let mut keys = (0..256).collect::>(); let mut rng = rand::rngs::SmallRng::from_seed([0; 32]); keys.shuffle(&mut rng); @@ -768,7 +768,7 @@ mod tests { let index = FacetIndex::::new(4, 8, 5); let mut txn = index.env.write_txn().unwrap(); - let mut keys = (0..256).into_iter().collect::>(); + let mut keys = (0..256).collect::>(); let mut rng = rand::rngs::SmallRng::from_seed([0; 32]); keys.shuffle(&mut rng); @@ -796,7 +796,7 @@ mod tests { index.insert(&mut txn, 0, &(i as f64), &bitmap); } - for i in (200..256).into_iter().rev() { + for i in (200..256).rev() { index.verify_structure_validity(&txn, 0); index.delete_single_docid(&mut txn, 0, &(i as f64), i as u32); } @@ -805,7 +805,7 @@ mod tests { milli_snap!(format!("{index}"), 200); let mut txn = index.env.write_txn().unwrap(); - for i in (150..200).into_iter().rev() { + for i in (150..200).rev() { index.verify_structure_validity(&txn, 0); index.delete_single_docid(&mut txn, 0, &(i as f64), i as u32); } @@ -813,7 +813,7 @@ mod tests { txn.commit().unwrap(); milli_snap!(format!("{index}"), 150); let mut txn = index.env.write_txn().unwrap(); - for i in (100..150).into_iter().rev() { + for i in (100..150).rev() { index.verify_structure_validity(&txn, 0); index.delete_single_docid(&mut txn, 0, &(i as f64), i as u32); } @@ -821,7 +821,7 @@ mod tests { txn.commit().unwrap(); milli_snap!(format!("{index}"), 100); let mut txn = index.env.write_txn().unwrap(); - for i in (17..100).into_iter().rev() { + for i in (17..100).rev() { index.verify_structure_validity(&txn, 0); index.delete_single_docid(&mut txn, 0, &(i as f64), i as u32); } @@ -829,14 +829,14 @@ mod tests { txn.commit().unwrap(); milli_snap!(format!("{index}"), 17); let mut txn = index.env.write_txn().unwrap(); - for i in (15..17).into_iter().rev() { + for i in (15..17).rev() { index.delete_single_docid(&mut txn, 0, &(i as f64), i as u32); } index.verify_structure_validity(&txn, 0); txn.commit().unwrap(); milli_snap!(format!("{index}"), 15); let mut txn = index.env.write_txn().unwrap(); - for i in (0..15).into_iter().rev() { + for i in (0..15).rev() { index.verify_structure_validity(&txn, 0); index.delete_single_docid(&mut txn, 0, &(i as f64), i as u32); } @@ -893,7 +893,7 @@ mod tests { index.insert(&mut txn, 0, &(i as f64), &bitmap); } - let mut keys = (0..256).into_iter().collect::>(); + let mut keys = (0..256).collect::>(); let mut rng = rand::rngs::SmallRng::from_seed([0; 32]); keys.shuffle(&mut rng); @@ -930,7 +930,7 @@ mod tests { let index = FacetIndex::::new(4, 8, 5); let mut txn = index.env.write_txn().unwrap(); - let mut keys = (0..16).into_iter().collect::>(); + let mut keys = (0..16).collect::>(); let mut rng = rand::rngs::SmallRng::from_seed([0; 32]); keys.shuffle(&mut rng); for i in 0..4 { @@ -951,7 +951,7 @@ mod tests { let index = FacetIndex::::new(4, 8, 5); let mut txn = index.env.write_txn().unwrap(); - let mut keys = (0..64).into_iter().collect::>(); + let mut keys = (0..64).collect::>(); let mut rng = rand::rngs::SmallRng::from_seed([0; 32]); keys.shuffle(&mut rng); @@ -983,7 +983,7 @@ mod tests { let index = FacetIndex::::new(4, 8, 5); let mut txn = index.env.write_txn().unwrap(); - let mut keys = (1000..1064).into_iter().collect::>(); + let mut keys = (1000..1064).collect::>(); let mut rng = rand::rngs::SmallRng::from_seed([0; 32]); keys.shuffle(&mut rng); diff --git a/milli/src/update/index_documents/mod.rs b/milli/src/update/index_documents/mod.rs index 2a7930f84..ade217beb 100644 --- a/milli/src/update/index_documents/mod.rs +++ b/milli/src/update/index_documents/mod.rs @@ -1613,7 +1613,6 @@ mod tests { // Create 200 documents with a long text let content = { let documents_iter = (0..200i32) - .into_iter() .map(|i| serde_json::json!({ "id": i, "script": script })) .filter_map(|json| match json { serde_json::Value::Object(object) => Some(object), diff --git a/milli/src/update/words_prefix_position_docids.rs b/milli/src/update/words_prefix_position_docids.rs index 0822d0d26..eb036c52f 100644 --- a/milli/src/update/words_prefix_position_docids.rs +++ b/milli/src/update/words_prefix_position_docids.rs @@ -14,7 +14,7 @@ use crate::update::index_documents::{ create_sorter, merge_cbo_roaring_bitmaps, sorter_into_lmdb_database, valid_lmdb_key, CursorClonableMmap, MergeFn, }; -use crate::{bucketed_position, relative_from_absolute_position, Index, Result}; +use crate::{relative_from_absolute_position, Index, Result}; pub struct WordPrefixPositionDocids<'t, 'u, 'i> { wtxn: &'t mut heed::RwTxn<'i, 'u>,