mirror of
				https://github.com/meilisearch/meilisearch.git
				synced 2025-10-31 07:56:28 +00:00 
			
		
		
		
	Fix the compilation error of the dependency versions
This commit is contained in:
		| @@ -82,7 +82,8 @@ impl CboRoaringBitmapCodec { | ||||
|                     buffer.extend_from_slice(&integer.to_ne_bytes()); | ||||
|                 } | ||||
|             } else { | ||||
|                 let roaring = RoaringBitmap::from_sorted_iter(vec.into_iter()); | ||||
|                 // Integers *must* be ordered here, no matter what. | ||||
|                 let roaring = RoaringBitmap::from_sorted_iter(vec.into_iter()).unwrap(); | ||||
|                 roaring.serialize_into(buffer)?; | ||||
|             } | ||||
|         } else { | ||||
| @@ -152,25 +153,25 @@ mod tests { | ||||
|         let mut buffer = Vec::new(); | ||||
|  | ||||
|         let small_data = vec![ | ||||
|             RoaringBitmap::from_sorted_iter(1..4), | ||||
|             RoaringBitmap::from_sorted_iter(2..5), | ||||
|             RoaringBitmap::from_sorted_iter(4..6), | ||||
|             RoaringBitmap::from_sorted_iter(1..3), | ||||
|             RoaringBitmap::from_sorted_iter(1..4).unwrap(), | ||||
|             RoaringBitmap::from_sorted_iter(2..5).unwrap(), | ||||
|             RoaringBitmap::from_sorted_iter(4..6).unwrap(), | ||||
|             RoaringBitmap::from_sorted_iter(1..3).unwrap(), | ||||
|         ]; | ||||
|  | ||||
|         let small_data: Vec<_> = | ||||
|             small_data.iter().map(|b| CboRoaringBitmapCodec::bytes_encode(b).unwrap()).collect(); | ||||
|         CboRoaringBitmapCodec::merge_into(small_data.as_slice(), &mut buffer).unwrap(); | ||||
|         let bitmap = CboRoaringBitmapCodec::deserialize_from(&buffer).unwrap(); | ||||
|         let expected = RoaringBitmap::from_sorted_iter(1..6); | ||||
|         let expected = RoaringBitmap::from_sorted_iter(1..6).unwrap(); | ||||
|         assert_eq!(bitmap, expected); | ||||
|  | ||||
|         let medium_data = vec![ | ||||
|             RoaringBitmap::from_sorted_iter(1..4), | ||||
|             RoaringBitmap::from_sorted_iter(2..5), | ||||
|             RoaringBitmap::from_sorted_iter(4..8), | ||||
|             RoaringBitmap::from_sorted_iter(0..3), | ||||
|             RoaringBitmap::from_sorted_iter(7..23), | ||||
|             RoaringBitmap::from_sorted_iter(1..4).unwrap(), | ||||
|             RoaringBitmap::from_sorted_iter(2..5).unwrap(), | ||||
|             RoaringBitmap::from_sorted_iter(4..8).unwrap(), | ||||
|             RoaringBitmap::from_sorted_iter(0..3).unwrap(), | ||||
|             RoaringBitmap::from_sorted_iter(7..23).unwrap(), | ||||
|         ]; | ||||
|  | ||||
|         let medium_data: Vec<_> = | ||||
| @@ -179,7 +180,7 @@ mod tests { | ||||
|         CboRoaringBitmapCodec::merge_into(medium_data.as_slice(), &mut buffer).unwrap(); | ||||
|  | ||||
|         let bitmap = CboRoaringBitmapCodec::deserialize_from(&buffer).unwrap(); | ||||
|         let expected = RoaringBitmap::from_sorted_iter(0..23); | ||||
|         let expected = RoaringBitmap::from_sorted_iter(0..23).unwrap(); | ||||
|         assert_eq!(bitmap, expected); | ||||
|     } | ||||
| } | ||||
|   | ||||
| @@ -498,6 +498,7 @@ fn query_pair_proximity_docids( | ||||
| #[cfg(test)] | ||||
| pub mod test { | ||||
|     use std::collections::HashMap; | ||||
|     use std::iter; | ||||
|  | ||||
|     use maplit::hashmap; | ||||
|     use rand::rngs::StdRng; | ||||
| @@ -567,7 +568,8 @@ pub mod test { | ||||
|                     .iter() | ||||
|                     .enumerate() | ||||
|                     .map(|(i, w)| { | ||||
|                         (w.clone(), RoaringBitmap::from_sorted_iter(std::iter::once(i as u32))) | ||||
|                         let bitmap = RoaringBitmap::from_sorted_iter(iter::once(i as u32)).unwrap(); | ||||
|                         (w.clone(), bitmap) | ||||
|                     }) | ||||
|                     .collect()) | ||||
|             } else { | ||||
| @@ -622,7 +624,7 @@ pub mod test { | ||||
|                 } | ||||
|                 values.sort_unstable(); | ||||
|  | ||||
|                 RoaringBitmap::from_sorted_iter(values.into_iter()) | ||||
|                 RoaringBitmap::from_sorted_iter(values.into_iter()).unwrap() | ||||
|             } | ||||
|  | ||||
|             let word_docids = hashmap! { | ||||
|   | ||||
| @@ -587,8 +587,7 @@ mod test { | ||||
|                     values.push(rng.gen()); | ||||
|                 } | ||||
|                 values.sort_unstable(); | ||||
|  | ||||
|                 RoaringBitmap::from_sorted_iter(values.into_iter()) | ||||
|                 RoaringBitmap::from_sorted_iter(values.into_iter()).unwrap() | ||||
|             } | ||||
|  | ||||
|             TestContext { | ||||
|   | ||||
| @@ -186,7 +186,7 @@ impl<'t, 'u, 'i> DeleteDocuments<'t, 'u, 'i> { | ||||
|  | ||||
|         // We create the FST map of the external ids that we must delete. | ||||
|         external_ids.sort_unstable(); | ||||
|         let external_ids_to_delete = fst::Set::from_iter(external_ids.iter().map(AsRef::as_ref))?; | ||||
|         let external_ids_to_delete = fst::Set::from_iter(external_ids)?; | ||||
|  | ||||
|         // We acquire the current external documents ids map... | ||||
|         let mut new_external_documents_ids = self.index.external_documents_ids(self.wtxn)?; | ||||
| @@ -209,7 +209,7 @@ impl<'t, 'u, 'i> DeleteDocuments<'t, 'u, 'i> { | ||||
|             // the LMDB B-Tree two times but only once. | ||||
|             let mut iter = word_docids.prefix_iter_mut(self.wtxn, &word)?; | ||||
|             if let Some((key, mut docids)) = iter.next().transpose()? { | ||||
|                 if key == word.as_ref() { | ||||
|                 if key == word.as_str() { | ||||
|                     let previous_len = docids.len(); | ||||
|                     docids -= &self.documents_ids; | ||||
|                     if docids.is_empty() { | ||||
| @@ -230,7 +230,7 @@ impl<'t, 'u, 'i> DeleteDocuments<'t, 'u, 'i> { | ||||
|             words.iter().filter_map( | ||||
|                 |(word, must_remove)| { | ||||
|                     if *must_remove { | ||||
|                         Some(word.as_ref()) | ||||
|                         Some(word.as_str()) | ||||
|                     } else { | ||||
|                         None | ||||
|                     } | ||||
|   | ||||
		Reference in New Issue
	
	Block a user