Skip to content

Commit 75c2f18

Browse files
authored
chore: 2024 edition, disable vsencoding_codec, minor cleanups (#66)
1 parent 3901a52 commit 75c2f18

15 files changed

Lines changed: 31 additions & 24 deletions

File tree

Cargo.toml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ authors = [
77
"Yuri Astrakhan <YuriAstrakhan@gmail.com>",
88
]
99
repository = "https://github.com/jjcfrancisco/fastpfor"
10-
edition = "2021"
10+
edition = "2024"
1111
license = "MIT OR Apache-2.0"
1212
keywords = ["fastpfor", "compression"]
1313
categories = ["compression"]
@@ -42,8 +42,6 @@ criterion = "0.8"
4242
rand = "0.10.0"
4343

4444
[lints.rust]
45-
dead_code = "allow"
46-
unused_assignments = "allow"
4745
unused_qualifications = "warn"
4846
missing_docs = "warn"
4947

@@ -55,5 +53,4 @@ cast_possible_wrap = "allow"
5553
cast_sign_loss = "allow"
5654
missing_errors_doc = "allow"
5755
missing_panics_doc = "allow"
58-
must_use_candidate = "allow"
5956
unreadable_literal = "allow"

benches/fastpfor_benchmark.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ use std::hint::black_box;
55
use std::io::Cursor;
66
use std::num::NonZeroU32;
77

8-
use criterion::{criterion_group, criterion_main, BenchmarkId, Criterion, Throughput};
9-
use fastpfor::rust::{FastPFOR, Integer, BLOCK_SIZE_128, BLOCK_SIZE_256, DEFAULT_PAGE_SIZE};
8+
use criterion::{BenchmarkId, Criterion, Throughput, criterion_group, criterion_main};
9+
use fastpfor::rust::{BLOCK_SIZE_128, BLOCK_SIZE_256, DEFAULT_PAGE_SIZE, FastPFOR, Integer};
1010
use rand::rngs::StdRng;
1111
use rand::{RngExt as _, SeedableRng};
1212

build.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@
33
/// Builds the C++ `FastPFOR` library and bridge when the `cpp` feature is enabled.
44
#[cfg(feature = "cpp")]
55
fn build_fastpfor() {
6-
use std::{env, path::Path};
6+
use std::env;
7+
use std::path::Path;
78

89
assert!(
910
Path::new("cpp/CMakeLists.txt").exists(),

fuzz/fuzz_targets/common.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
use fastpfor::cpp;
2-
use fastpfor::rust;
1+
use fastpfor::{cpp, rust};
32

43
pub type BoxedCppCodec = Box<dyn cpp::Codec32>;
54

fuzz/fuzz_targets/rust_compress_oracle.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,11 @@ fuzz_target!(|data: FuzzInput<RustCodec>| {
7575
compressed_oracle_from_cpp.len()
7676
);
7777

78-
for (i, (&rust_val, &cpp_val)) in rust_result.iter().zip(compressed_oracle_from_cpp.iter()).enumerate() {
78+
for (i, (&rust_val, &cpp_val)) in rust_result
79+
.iter()
80+
.zip(compressed_oracle_from_cpp.iter())
81+
.enumerate()
82+
{
7983
assert_eq!(
8084
rust_val, cpp_val,
8185
"Compressed data mismatch at position {}: Rust={}, C++={}",

fuzz/fuzz_targets/rust_decompress_oracle.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#![no_main]
22

3-
use fastpfor::{cpp, rust, CodecToSlice};
3+
use fastpfor::{CodecToSlice, cpp, rust};
44
use libfuzzer_sys::fuzz_target;
55
mod common;
66
use common::*;

src/cpp/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ mod ffi {
2323
fn fastbinarypacking16_codec() -> UniquePtr<IntegerCODEC>;
2424
fn fastbinarypacking32_codec() -> UniquePtr<IntegerCODEC>;
2525
fn BP32_codec() -> UniquePtr<IntegerCODEC>;
26-
fn vsencoding_codec() -> UniquePtr<IntegerCODEC>;
26+
// fn vsencoding_codec() -> UniquePtr<IntegerCODEC>;
2727
fn fastpfor128_codec() -> UniquePtr<IntegerCODEC>;
2828
fn fastpfor256_codec() -> UniquePtr<IntegerCODEC>;
2929
fn simdfastpfor128_codec() -> UniquePtr<IntegerCODEC>;

src/rust/integer_compression/codec.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
use std::io::Cursor;
22

3-
use crate::rust::{FastPFOR, FastPForResult, Integer, JustCopy, VariableByte};
43
use crate::CodecToSlice;
4+
use crate::rust::{FastPFOR, FastPForResult, Integer, JustCopy, VariableByte};
55

66
/// Type-erased wrapper for compression codecs.
77
///

src/rust/integer_compression/differential/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ pub struct Delta;
55

66
impl Delta {
77
/// Creates a new instance
8+
#[must_use]
89
pub fn new() -> Delta {
910
Delta
1011
}

src/rust/integer_compression/fastpfor.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,7 @@ impl FastPFOR {
148148
/// Creates codec with specified page and block sizes.
149149
///
150150
/// Pre-allocates buffers for metadata and exception storage.
151+
#[must_use]
151152
pub fn new(page_size: NonZeroU32, block_size: NonZeroU32) -> FastPFOR {
152153
let page_size = page_size.get();
153154
let block_size = block_size.get();

0 commit comments

Comments
 (0)