mirror of
https://github.com/meilisearch/MeiliSearch
synced 2025-07-04 20:37:15 +02:00
Simplify the the facet types
This commit is contained in:
parent
466fb601d6
commit
cf9ddd293d
4 changed files with 40 additions and 57 deletions
|
@ -13,16 +13,6 @@ pub fn f64_into_bytes(float: f64) -> Option<[u8; 8]> {
|
|||
None
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn u64_into_bytes(int: u64) -> [u8; 8] {
|
||||
int.to_be_bytes()
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn u64_from_bytes(bytes: [u8; 8]) -> u64 {
|
||||
u64::from_be_bytes(bytes)
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn i64_into_bytes(int: i64) -> [u8; 8] {
|
||||
xor_first_bit(int.to_be_bytes())
|
||||
|
@ -66,16 +56,6 @@ mod tests {
|
|||
assert!(is_sorted(&vec), "{:?}", vec);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn ordered_u64_bytes() {
|
||||
let a = 0_u64;
|
||||
let b = 1_u64;
|
||||
let c = 43_u64;
|
||||
|
||||
let vec: Vec<_> = [a, b, c].iter().cloned().map(u64_into_bytes).collect();
|
||||
assert!(is_sorted(&vec), "{:?}", vec);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn ordered_i64_bytes() {
|
||||
let a = -10_i64;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue