Skip to content

Commit d12c1cd

Browse files
authored
fix: fixes pre v0.3.1 (#15)
1 parent 6d98900 commit d12c1cd

3 files changed

Lines changed: 6 additions & 13 deletions

File tree

README.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,7 @@
99
FastPFOR library written in Rust. Currently in development.
1010

1111
## To do:
12-
- [ ] Remove fast_pack0 function: noop
13-
- [ ] Implement traits for fastpfor
14-
- [ ] Change Ok(()) to FastPForResult in fastpfor.rs
12+
- [ ] Rust wrapper for the [C++ library](https://github.com/fast-pack/FastPFor): try [`cxxbridge`](https://github.com/dtolnay/cxx) or [`bindgen`](https://crates.io/crates/bindgen)
1513

1614
## License
1715

src/bitpacking.rs

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
pub fn fast_pack(input: &[i32], inpos: usize, output: &mut [i32], outpos: usize, bit: isize) {
44
match bit {
5-
0 => fast_pack0(input, inpos, output, outpos),
5+
0 => (),
66
1 => fast_pack1(input, inpos, output, outpos),
77
2 => fast_pack2(input, inpos, output, outpos),
88
3 => fast_pack3(input, inpos, output, outpos),
@@ -39,11 +39,6 @@ pub fn fast_pack(input: &[i32], inpos: usize, output: &mut [i32], outpos: usize,
3939
}
4040
}
4141

42-
#[expect(unused_variables)]
43-
fn fast_pack0(input: &[i32], inpos: usize, output: &mut [i32], outpos: usize) {
44-
// Nothing
45-
}
46-
4742
fn fast_pack1(input: &[i32], inpos: usize, output: &mut [i32], outpos: usize) {
4843
output[0 + outpos] = (input[0 + inpos] >> 0) & 1;
4944
output[1 + outpos] = (input[0 + inpos] >> 1) & 1;

src/fastpfor.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ impl Compressor<i32> for FastPFOR {
3333
let inlength = helpers::greatest_multiple(input_length, self.block_size as i32);
3434
if self.block_size == BLOCK_SIZE_256 && inlength == 0 {
3535
// Return early if there is no data to compress
36-
return Ok(());
36+
return FastPForResult::Ok(());
3737
}
3838
output[output_offset.position() as usize] = inlength;
3939
output_offset.increment();
@@ -44,7 +44,7 @@ impl Compressor<i32> for FastPFOR {
4444
let this_size = std::cmp::min(self.page_size, final_inpos - pos);
4545
self.encode_page(input, input_offset, this_size, output, output_offset);
4646
}
47-
Ok(())
47+
FastPForResult::Ok(())
4848
}
4949

5050
fn uncompress(
@@ -57,7 +57,7 @@ impl Compressor<i32> for FastPFOR {
5757
) -> FastPForResult<()> {
5858
if inlength == 0 {
5959
// Return early if there is no data to compress
60-
return Ok(());
60+
return FastPForResult::Ok(());
6161
}
6262
let outlength = input[input_offset.position() as usize];
6363
input_offset.increment();
@@ -68,7 +68,7 @@ impl Compressor<i32> for FastPFOR {
6868
std::cmp::min(self.page_size, final_out - output_offset.position() as i32);
6969
self.decode_page(input, input_offset, output, output_offset, this_size);
7070
}
71-
Ok(())
71+
FastPForResult::Ok(())
7272
}
7373
}
7474

0 commit comments

Comments
 (0)