Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Apply Clippy 0.1.85's new suggestions #44

Merged
merged 2 commits into from
Mar 12, 2025
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
2 changes: 1 addition & 1 deletion src/array_decoder/list.rs
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ impl ArrayBatchDecoder for ListArrayDecoder {
// Fetch child array as one Array with total_length elements
let child_array = self.inner.next_batch(total_length as usize, None)?;
let offsets = OffsetBuffer::from_lengths(lengths.into_iter().map(|l| l as usize));
let null_buffer = present.map(NullBuffer::from);
let null_buffer = present;

let array = ListArray::try_new(self.field.clone(), offsets, child_array, null_buffer)
.context(ArrowSnafu)?;
Expand Down
2 changes: 1 addition & 1 deletion src/array_decoder/struct_decoder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ impl ArrayBatchDecoder for StructArrayDecoder {
.map(|child| child.next_batch(batch_size, present.as_ref()))
.collect::<Result<Vec<_>>>()?;

let null_buffer = present.map(NullBuffer::from);
let null_buffer = present;
let array = StructArray::try_new(self.fields.clone(), child_arrays, null_buffer)
.context(ArrowSnafu)?;
let array = Arc::new(array);
Expand Down
2 changes: 1 addition & 1 deletion src/encoding/integer/rle_v2/delta.rs
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ fn derive_delta_header(delta_width: usize, run_length: usize) -> [u8; 2] {
let encoded_length_high_bit = (run_length >> 8) as u8;
let encoded_length_low_bits = (run_length & 0xFF) as u8;

let header1 = EncodingType::Delta.to_header() | delta_width << 1 | encoded_length_high_bit;
let header1 = EncodingType::Delta.to_header() | (delta_width << 1) | encoded_length_high_bit;
let header2 = encoded_length_low_bits;

[header1, header2]
Expand Down
6 changes: 3 additions & 3 deletions src/encoding/integer/rle_v2/patched_base.rs
Original file line number Diff line number Diff line change
Expand Up @@ -256,10 +256,10 @@ pub fn write_patched_base(
let encoded_patch_gap_width = patch_gap_width - 1;

let header1 =
EncodingType::PatchedBase.to_header() | encoded_bit_width << 1 | encoded_length_high_bit;
EncodingType::PatchedBase.to_header() | (encoded_bit_width << 1) | encoded_length_high_bit;
let header2 = encoded_length_low_bits;
let header3 = (encoded_base_width as u8) << 5 | encoded_patch_bits_width as u8;
let header4 = (encoded_patch_gap_width as u8) << 5 | patches.len() as u8;
let header3 = ((encoded_base_width as u8) << 5) | encoded_patch_bits_width as u8;
let header4 = ((encoded_patch_gap_width as u8) << 5) | patches.len() as u8;
writer.put_slice(&[header1, header2, header3, header4]);

// Write out base value as big endian bytes
Expand Down
Loading