Skip to content

Commit c26a0a1

Browse files
authored
Enable more lints (#1315)
1 parent 630b381 commit c26a0a1

File tree

7 files changed

+31
-36
lines changed

7 files changed

+31
-36
lines changed

.github/workflows/rust.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,7 @@ jobs:
247247
run: |
248248
export CARGO_HOME="/github/home/.cargo"
249249
export CARGO_TARGET_DIR="/github/home/target"
250-
cargo clippy --features test_common --features prettyprint --features=async --all-targets --workspace -- -D warnings -A clippy::redundant_field_names
250+
cargo clippy --features test_common --features prettyprint --features=async --all-targets --workspace -- -D warnings
251251
252252
check_benches:
253253
name: Check Benchmarks (but don't run them)

arrow/src/buffer/ops.rs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -34,18 +34,18 @@ use super::{Buffer, MutableBuffer};
3434
/// Contrary to the non-simd version `bitwise_bin_op_helper`, the offset and length is specified in bytes
3535
/// and this version does not support operations starting at arbitrary bit offsets.
3636
#[cfg(feature = "simd")]
37-
pub fn bitwise_bin_op_simd_helper<F_SIMD, F_SCALAR>(
37+
pub fn bitwise_bin_op_simd_helper<SI, SC>(
3838
left: &Buffer,
3939
left_offset: usize,
4040
right: &Buffer,
4141
right_offset: usize,
4242
len: usize,
43-
simd_op: F_SIMD,
44-
scalar_op: F_SCALAR,
43+
simd_op: SI,
44+
scalar_op: SC,
4545
) -> Buffer
4646
where
47-
F_SIMD: Fn(u8x64, u8x64) -> u8x64,
48-
F_SCALAR: Fn(u8, u8) -> u8,
47+
SI: Fn(u8x64, u8x64) -> u8x64,
48+
SC: Fn(u8, u8) -> u8,
4949
{
5050
let mut result = MutableBuffer::new(len).with_bitset(len, false);
5151
let lanes = u8x64::lanes();
@@ -83,16 +83,16 @@ where
8383
/// Contrary to the non-simd version `bitwise_unary_op_helper`, the offset and length is specified in bytes
8484
/// and this version does not support operations starting at arbitrary bit offsets.
8585
#[cfg(feature = "simd")]
86-
pub fn bitwise_unary_op_simd_helper<F_SIMD, F_SCALAR>(
86+
pub fn bitwise_unary_op_simd_helper<SI, SC>(
8787
left: &Buffer,
8888
left_offset: usize,
8989
len: usize,
90-
simd_op: F_SIMD,
91-
scalar_op: F_SCALAR,
90+
simd_op: SI,
91+
scalar_op: SC,
9292
) -> Buffer
9393
where
94-
F_SIMD: Fn(u8x64) -> u8x64,
95-
F_SCALAR: Fn(u8) -> u8,
94+
SI: Fn(u8x64) -> u8x64,
95+
SC: Fn(u8) -> u8,
9696
{
9797
let mut result = MutableBuffer::new(len).with_bitset(len, false);
9898
let lanes = u8x64::lanes();

arrow/src/compute/kernels/arithmetic.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -296,17 +296,17 @@ where
296296
/// * the arrays have different lengths
297297
/// * there is an element where both left and right values are valid and the right value is `0`
298298
#[cfg(feature = "simd")]
299-
fn simd_checked_divide_op<T, SIMD_OP, SCALAR_OP>(
299+
fn simd_checked_divide_op<T, SI, SC>(
300300
left: &PrimitiveArray<T>,
301301
right: &PrimitiveArray<T>,
302-
simd_op: SIMD_OP,
303-
scalar_op: SCALAR_OP,
302+
simd_op: SI,
303+
scalar_op: SC,
304304
) -> Result<PrimitiveArray<T>>
305305
where
306306
T: ArrowNumericType,
307307
T::Native: One + Zero,
308-
SIMD_OP: Fn(Option<u64>, T::Simd, T::Simd) -> Result<T::Simd>,
309-
SCALAR_OP: Fn(T::Native, T::Native) -> T::Native,
308+
SI: Fn(Option<u64>, T::Simd, T::Simd) -> Result<T::Simd>,
309+
SC: Fn(T::Native, T::Native) -> T::Native,
310310
{
311311
if left.len() != right.len() {
312312
return Err(ArrowError::ComputeError(

arrow/src/compute/kernels/comparison.rs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1655,16 +1655,16 @@ where
16551655
/// Helper function to perform boolean lambda function on values from two arrays using
16561656
/// SIMD.
16571657
#[cfg(feature = "simd")]
1658-
fn simd_compare_op<T, SIMD_OP, SCALAR_OP>(
1658+
fn simd_compare_op<T, SI, SC>(
16591659
left: &PrimitiveArray<T>,
16601660
right: &PrimitiveArray<T>,
1661-
simd_op: SIMD_OP,
1662-
scalar_op: SCALAR_OP,
1661+
simd_op: SI,
1662+
scalar_op: SC,
16631663
) -> Result<BooleanArray>
16641664
where
16651665
T: ArrowNumericType,
1666-
SIMD_OP: Fn(T::Simd, T::Simd) -> T::SimdMask,
1667-
SCALAR_OP: Fn(T::Native, T::Native) -> bool,
1666+
SI: Fn(T::Simd, T::Simd) -> T::SimdMask,
1667+
SC: Fn(T::Native, T::Native) -> bool,
16681668
{
16691669
use std::borrow::BorrowMut;
16701670

@@ -1755,16 +1755,16 @@ where
17551755
/// Helper function to perform boolean lambda function on values from an array and a scalar value using
17561756
/// SIMD.
17571757
#[cfg(feature = "simd")]
1758-
fn simd_compare_op_scalar<T, SIMD_OP, SCALAR_OP>(
1758+
fn simd_compare_op_scalar<T, SI, SC>(
17591759
left: &PrimitiveArray<T>,
17601760
right: T::Native,
1761-
simd_op: SIMD_OP,
1762-
scalar_op: SCALAR_OP,
1761+
simd_op: SI,
1762+
scalar_op: SC,
17631763
) -> Result<BooleanArray>
17641764
where
17651765
T: ArrowNumericType,
1766-
SIMD_OP: Fn(T::Simd, T::Simd) -> T::SimdMask,
1767-
SCALAR_OP: Fn(T::Native, T::Native) -> bool,
1766+
SI: Fn(T::Simd, T::Simd) -> T::SimdMask,
1767+
SC: Fn(T::Native, T::Native) -> bool,
17681768
{
17691769
use std::borrow::BorrowMut;
17701770

arrow/src/ipc/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ pub mod writer;
2727
#[allow(clippy::extra_unused_lifetimes)]
2828
#[allow(clippy::redundant_static_lifetimes)]
2929
#[allow(clippy::redundant_field_names)]
30+
#[allow(non_camel_case_types)]
3031
pub mod gen;
3132

3233
pub use self::gen::File::*;

arrow/src/json/reader.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -735,14 +735,14 @@ impl Decoder {
735735
}
736736

737737
#[inline(always)]
738-
fn list_array_string_array_builder<DICT_TY>(
738+
fn list_array_string_array_builder<DT>(
739739
&self,
740740
data_type: &DataType,
741741
col_name: &str,
742742
rows: &[Value],
743743
) -> Result<ArrayRef>
744744
where
745-
DICT_TY: ArrowPrimitiveType + ArrowDictionaryKeyType,
745+
DT: ArrowPrimitiveType + ArrowDictionaryKeyType,
746746
{
747747
let mut builder: Box<dyn ArrayBuilder> = match data_type {
748748
DataType::Utf8 => {
@@ -751,7 +751,7 @@ impl Decoder {
751751
}
752752
DataType::Dictionary(_, _) => {
753753
let values_builder =
754-
self.build_string_dictionary_builder::<DICT_TY>(rows.len() * 5)?;
754+
self.build_string_dictionary_builder::<DT>(rows.len() * 5)?;
755755
Box::new(ListBuilder::new(values_builder))
756756
}
757757
e => {
@@ -813,7 +813,7 @@ impl Decoder {
813813
builder.append(true)?;
814814
}
815815
DataType::Dictionary(_, _) => {
816-
let builder = builder.as_any_mut().downcast_mut::<ListBuilder<StringDictionaryBuilder<DICT_TY>>>().ok_or_else(||ArrowError::JsonError(
816+
let builder = builder.as_any_mut().downcast_mut::<ListBuilder<StringDictionaryBuilder<DT>>>().ok_or_else(||ArrowError::JsonError(
817817
"Cast failed for ListBuilder<StringDictionaryBuilder> during nested data parsing".to_string(),
818818
))?;
819819
for val in vals {

arrow/src/lib.rs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -128,13 +128,7 @@
128128
#![cfg_attr(feature = "avx512", feature(repr_simd))]
129129
#![cfg_attr(feature = "avx512", feature(avx512_target_feature))]
130130
#![allow(dead_code)]
131-
#![allow(non_camel_case_types)]
132131
#![deny(clippy::redundant_clone)]
133-
#![allow(
134-
// upper_case_acronyms lint was introduced in Rust 1.51.
135-
// It is triggered in the ffi module, and ipc::gen, which we have no control over
136-
clippy::upper_case_acronyms,
137-
)]
138132
#![warn(missing_debug_implementations)]
139133

140134
pub mod alloc;

0 commit comments

Comments
 (0)