Simplify the the facet types

This commit is contained in:
Clément Renault 2020-11-13 11:45:37 +01:00
parent 466fb601d6
commit cf9ddd293d
No known key found for this signature in database
GPG key ID: 92ADA4E935E71FA4
4 changed files with 40 additions and 57 deletions

View file

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