diff --git a/crates/nano-arrow/src/bitmap/bitmask.rs b/crates/nano-arrow/src/bitmap/bitmask.rs index 8c9d0f9245cb..d1a72b96a472 100644 --- a/crates/nano-arrow/src/bitmap/bitmask.rs +++ b/crates/nano-arrow/src/bitmap/bitmask.rs @@ -94,6 +94,7 @@ fn load_padded_le_u64(bytes: &[u8]) -> u64 { lo | mid | hi } +#[derive(Default, Clone)] pub struct BitMask<'a> { bytes: &'a [u8], offset: usize, @@ -232,16 +233,6 @@ impl<'a> BitMask<'a> { } } -impl<'a> Default for BitMask<'a> { - fn default() -> Self { - Self { - bytes: &[], - offset: 0, - len: 0, - } - } -} - #[cfg(test)] mod test { use super::*; diff --git a/crates/nano-arrow/src/compute/concatenate.rs b/crates/nano-arrow/src/compute/concatenate.rs index 5c80d2d10a6b..48db6c141e27 100644 --- a/crates/nano-arrow/src/compute/concatenate.rs +++ b/crates/nano-arrow/src/compute/concatenate.rs @@ -47,7 +47,6 @@ pub fn concatenate(arrays: &[&dyn Array]) -> Result> { Ok(mutable.as_box()) } - /// Concatenate the validities of multiple [Array]s into a single Bitmap. pub fn concatenate_validities(arrays: &[&dyn Array]) -> Option { let null_count: usize = arrays.iter().map(|a| a.null_count()).sum(); diff --git a/crates/polars-core/src/datatypes/mod.rs b/crates/polars-core/src/datatypes/mod.rs index d99e0b03367e..ed0ec749737c 100644 --- a/crates/polars-core/src/datatypes/mod.rs +++ b/crates/polars-core/src/datatypes/mod.rs @@ -62,7 +62,7 @@ pub unsafe trait PolarsDataType: Send + Sync + Sized { type ZeroablePhysical<'a>: Zeroable + From>; type Array: for<'a> StaticArray< ValueT<'a> = Self::Physical<'a>, - ZeroableValueT<'a> = Self::ZeroablePhysical<'a> + ZeroableValueT<'a> = Self::ZeroablePhysical<'a>, >; fn get_dtype() -> DataType diff --git a/crates/polars-core/src/datatypes/static_array.rs b/crates/polars-core/src/datatypes/static_array.rs index c91f9e6a6219..8ec8a9f7cf25 100644 --- a/crates/polars-core/src/datatypes/static_array.rs +++ b/crates/polars-core/src/datatypes/static_array.rs @@ -68,7 +68,7 @@ pub trait StaticArray: fn iter(&self) -> ZipValidity, Self::ValueIterT<'_>, BitmapIter>; fn values_iter(&self) -> Self::ValueIterT<'_>; fn with_validity_typed(self, validity: Option) -> Self; - + fn from_vec(v: Vec>, dtype: DataType) -> Self { v.into_iter().collect_arr_with_dtype(dtype) } @@ -108,7 +108,7 @@ impl StaticArray for PrimitiveArray { fn with_validity_typed(self, validity: Option) -> Self { self.with_validity(validity) } - + fn from_vec(v: Vec>, _dtype: DataType) -> Self { PrimitiveArray::from_vec(v) } @@ -145,13 +145,13 @@ impl StaticArray for BooleanArray { fn with_validity_typed(self, validity: Option) -> Self { self.with_validity(validity) } - + fn from_vec(v: Vec>, _dtype: DataType) -> Self { - BooleanArray::from_slice(&v) + BooleanArray::from_slice(v) } - + fn from_zeroable_vec(v: Vec>, _dtype: DataType) -> Self { - BooleanArray::from_slice(&v) + BooleanArray::from_slice(v) } } diff --git a/crates/polars-ops/src/chunked_array/gather_skip_nulls.rs b/crates/polars-ops/src/chunked_array/gather_skip_nulls.rs index 5690d7e9817d..57b39394fc35 100644 --- a/crates/polars-ops/src/chunked_array/gather_skip_nulls.rs +++ b/crates/polars-ops/src/chunked_array/gather_skip_nulls.rs @@ -13,7 +13,7 @@ unsafe fn gather_skip_null_idx_pairs_unchecked<'a, T: PolarsDataType>( mut index_pairs: Vec<(IdxSize, IdxSize)>, len: usize, ) -> Vec> { - if index_pairs.len() == 0 { + if index_pairs.is_empty() { return zeroed_vec(len); }