mirror of
https://github.com/meilisearch/MeiliSearch
synced 2025-07-04 20:37:15 +02:00
Fix Pr comments
This commit is contained in:
parent
4860fd4529
commit
db0c681bae
14 changed files with 38 additions and 58 deletions
|
@ -5,6 +5,7 @@ use std::{marker, str};
|
|||
use crate::error::SerializationError;
|
||||
use crate::heed_codec::RoaringBitmapCodec;
|
||||
use crate::{try_split_array_at, try_split_at, Result};
|
||||
|
||||
pub type FacetStringLevelZeroValueCodec = StringValueCodec<RoaringBitmapCodec>;
|
||||
|
||||
/// A codec that encodes a string in front of a value.
|
||||
|
@ -22,7 +23,6 @@ where
|
|||
|
||||
fn bytes_decode(bytes: &'a [u8]) -> Option<Self::DItem> {
|
||||
let (string, bytes) = decode_prefix_string(bytes)?;
|
||||
|
||||
C::bytes_decode(bytes).map(|item| (string, item))
|
||||
}
|
||||
}
|
||||
|
@ -49,7 +49,6 @@ pub fn decode_prefix_string(value: &[u8]) -> Option<(&str, &[u8])> {
|
|||
let original_length = u16::from_be_bytes(original_length_bytes) as usize;
|
||||
let (string, bytes) = try_split_at(bytes, original_length)?;
|
||||
let string = str::from_utf8(string).ok()?;
|
||||
|
||||
Some((string, bytes))
|
||||
}
|
||||
|
||||
|
|
|
@ -55,9 +55,9 @@ impl CboRoaringBitmapCodec {
|
|||
|
||||
/// Merge serialized CboRoaringBitmaps in a buffer.
|
||||
///
|
||||
/// if the merged values len is under the threshold,
|
||||
/// values are directly serialized in the buffer;
|
||||
/// else a RoaringBitmap is created from the values and is serialized in the buffer.
|
||||
/// if the merged values length is under the threshold, values are directly
|
||||
/// serialized in the buffer else a RoaringBitmap is created from the
|
||||
/// values and is serialized in the buffer.
|
||||
pub fn merge_into(slices: &[Cow<[u8]>], buffer: &mut Vec<u8>) -> io::Result<()> {
|
||||
let mut roaring = RoaringBitmap::new();
|
||||
let mut vec = Vec::new();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue