Skip to content

Commit

Permalink
clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
coastalwhite committed Nov 1, 2024
1 parent d246d86 commit 9ea1775
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions crates/polars-io/src/parquet/read/read_impl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -905,8 +905,8 @@ pub fn read_parquet<R: MmapBytesReader>(
let mut do_prefilter = false;

do_prefilter |= prefilter_env == Ok("1"); // Force enable
do_prefilter |= (num_live_variables * n_row_groups >= POOL.current_num_threads()
&& materialized_projection.len() >= num_live_variables);
do_prefilter |= num_live_variables * n_row_groups >= POOL.current_num_threads()
&& materialized_projection.len() >= num_live_variables;

do_prefilter &= prefilter_env != Ok("0"); // Force disable

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ pub struct BatchedNestedDecoder<'a> {
validity: &'a mut MutableBitmap,
}

impl<'a> BatchedNestedDecoder<'a> {
impl BatchedNestedDecoder<'_> {
fn push_valid(&mut self) -> ParquetResult<()> {
self.push_n_valids(1)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ impl<'a, D: Decoder> State<'a, D> {
let mut page_validity = None;

// Make the page_validity None if there are no nulls in the page
if is_optional && !page.null_count().is_some_and(|nc| nc == 0) {
if is_optional && page.null_count().is_none_or(|nc| nc != 0) {
let pv = page_validity_decoder(page)?;
let pv = decode_page_validity(pv, None)?;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ impl<'a> Decoder<'a> {
}
}

impl<'a> Iterator for Decoder<'a> {
impl Iterator for Decoder<'_> {
type Item = ParquetResult<Vec<u8>>;

fn next(&mut self) -> Option<Self::Item> {
Expand Down Expand Up @@ -92,7 +92,7 @@ impl<'a> Iterator for Decoder<'a> {
}
}

impl<'a> ExactSizeIterator for Decoder<'a> {}
impl ExactSizeIterator for Decoder<'_> {}

#[cfg(test)]
mod tests {
Expand Down
4 changes: 2 additions & 2 deletions crates/polars-utils/src/chunks.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ impl<'a, T> Iterator for Chunks<'a, T> {
}
}

impl<'a, T> DoubleEndedIterator for Chunks<'a, T> {
impl<T> DoubleEndedIterator for Chunks<'_, T> {
fn next_back(&mut self) -> Option<Self::Item> {
if self.slice.is_empty() {
return None;
Expand All @@ -41,7 +41,7 @@ impl<'a, T> DoubleEndedIterator for Chunks<'a, T> {
}
}

impl<'a, T> ExactSizeIterator for Chunks<'a, T> {}
impl<T> ExactSizeIterator for Chunks<'_, T> {}

impl<'a, T> Chunks<'a, T> {
pub const fn new(slice: &'a [T], chunk_size: usize) -> Self {
Expand Down

0 comments on commit 9ea1775

Please sign in to comment.