Fix Pr comments

This commit is contained in:
many 2021-09-02 15:17:52 +02:00
parent 4860fd4529
commit db0c681bae
No known key found for this signature in database
GPG key ID: 2CEF23B75189EACA
14 changed files with 38 additions and 58 deletions

View file

@ -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))
}

View file

@ -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();