Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ missing_docs = "warn"
[lints.clippy]
cargo = { level = "warn", priority = -1 }
pedantic = { level = "warn", priority = -1 }
use_self = "warn"
cast_possible_truncation = "allow"
cast_possible_wrap = "allow"
cast_sign_loss = "allow"
Expand Down
1 change: 1 addition & 0 deletions fuzz/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ unused_qualifications = "warn"
[lints.clippy]
cargo = { level = "warn", priority = -1 }
pedantic = { level = "warn", priority = -1 }
use_self = "warn"
# Allow certain lints that are common in fuzz targets and not worth fixing.
doc_markdown = "allow"
wildcard_imports = "allow"
Expand Down
2 changes: 1 addition & 1 deletion src/rust/integer_compression/fastpfor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ impl<const N: usize> FastPFor<N> {
block_size: N as u32,
});
}
Ok(FastPFor {
Ok(Self {
bytes_container: BytesMut::with_capacity(
(3 * page_size / N as u32 + page_size) as usize,
),
Expand Down
10 changes: 2 additions & 8 deletions src/rust/integer_compression/just_copy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,14 @@ use crate::helpers::AsUsize;
/// A no-op codec that copies data without compression.
///
/// Useful as a baseline for benchmarking or when a codec interface is required.
#[derive(Debug)]
#[derive(Debug, Default)]
pub struct JustCopy;

impl JustCopy {
/// Creates a new instance
#[must_use]
pub fn new() -> Self {
JustCopy
}
}

impl Default for JustCopy {
fn default() -> Self {
JustCopy::new()
Self
}
}

Expand Down
16 changes: 5 additions & 11 deletions src/rust/integer_compression/variable_byte.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ use crate::rust::cursor::IncrementCursor;
use crate::{FastPForError, FastPForResult};

/// Variable-byte encoding codec for integer compression.
#[derive(Debug)]
#[derive(Debug, Default)]
pub struct VariableByte;

// Helper functions with const generics for extracting 7-bit chunks
Expand All @@ -28,8 +28,8 @@ impl VariableByte {
impl VariableByte {
/// Creates a new instance
#[must_use]
pub fn new() -> VariableByte {
VariableByte
pub fn new() -> Self {
Self
}

/// Compress `input_length` u32 values from `input[input_offset..]` into
Expand Down Expand Up @@ -301,20 +301,14 @@ impl VariableByte {
}
}

impl Default for VariableByte {
fn default() -> Self {
VariableByte::new()
}
}

impl AnyLenCodec for VariableByte {
fn encode(&mut self, input: &[u32], out: &mut Vec<u32>) -> FastPForResult<()> {
let capacity = input.len() * 2 + 4;
let start = out.len();
out.resize(start + capacity, 0);
let mut in_off = Cursor::new(0u32);
let mut out_off = Cursor::new(0u32);
VariableByte::compress_into_slice(
Self::compress_into_slice(
input,
input.len() as u32,
&mut in_off,
Expand Down Expand Up @@ -342,7 +336,7 @@ impl AnyLenCodec for VariableByte {
out.resize(start + capacity, 0);
let mut in_off = Cursor::new(0u32);
let mut out_off = Cursor::new(0u32);
VariableByte::decompress_from_u32_slice(
Self::decompress_from_u32_slice(
input,
input.len() as u32,
&mut in_off,
Expand Down