Skip to content

Commit de9f826

Browse files
authored
Update to latest Clippy (#3832)
* Renamed clippy lint * More clippy * Even more clippy * Clippy
1 parent fb35d26 commit de9f826

File tree

7 files changed

+11
-17
lines changed

7 files changed

+11
-17
lines changed

arrow-arith/src/arithmetic.rs

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2571,9 +2571,9 @@ mod tests {
25712571

25722572
#[test]
25732573
fn test_primitive_array_negate() {
2574-
let a: Int64Array = (0..100).into_iter().map(Some).collect();
2574+
let a: Int64Array = (0..100).map(Some).collect();
25752575
let actual = negate(&a).unwrap();
2576-
let expected: Int64Array = (0..100).into_iter().map(|i| Some(-i)).collect();
2576+
let expected: Int64Array = (0..100).map(|i| Some(-i)).collect();
25772577
assert_eq!(expected, actual);
25782578
}
25792579

@@ -2590,20 +2590,18 @@ mod tests {
25902590

25912591
#[test]
25922592
fn test_arithmetic_kernel_should_not_rely_on_padding() {
2593-
let a: UInt8Array = (0..128_u8).into_iter().map(Some).collect();
2593+
let a: UInt8Array = (0..128_u8).map(Some).collect();
25942594
let a = a.slice(63, 65);
25952595
let a = a.as_any().downcast_ref::<UInt8Array>().unwrap();
25962596

2597-
let b: UInt8Array = (0..128_u8).into_iter().map(Some).collect();
2597+
let b: UInt8Array = (0..128_u8).map(Some).collect();
25982598
let b = b.slice(63, 65);
25992599
let b = b.as_any().downcast_ref::<UInt8Array>().unwrap();
26002600

26012601
let actual = add(a, b).unwrap();
26022602
let actual: Vec<Option<u8>> = actual.iter().collect();
2603-
let expected: Vec<Option<u8>> = (63..63_u8 + 65_u8)
2604-
.into_iter()
2605-
.map(|i| Some(i + i))
2606-
.collect();
2603+
let expected: Vec<Option<u8>> =
2604+
(63..63_u8 + 65_u8).map(|i| Some(i + i)).collect();
26072605
assert_eq!(expected, actual);
26082606
}
26092607

arrow-schema/src/schema.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,7 @@ impl fmt::Display for Schema {
264264
}
265265

266266
// need to implement `Hash` manually because `HashMap` implement Eq but no `Hash`
267-
#[allow(clippy::derive_hash_xor_eq)]
267+
#[allow(clippy::derived_hash_with_manual_eq)]
268268
impl Hash for Schema {
269269
fn hash<H: std::hash::Hasher>(&self, state: &mut H) {
270270
self.fields.hash(state);

arrow/benches/boolean_append_packed.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ fn boolean_append_packed(c: &mut Criterion) {
3030
let mut rng = thread_rng();
3131
let source = rand_bytes(1024);
3232
let ranges: Vec<_> = (0..100)
33-
.into_iter()
3433
.map(|_| {
3534
let start: usize = rng.gen_range(0..1024 * 8);
3635
let end: usize = rng.gen_range(start..1024 * 8);

arrow/src/array/ffi.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,7 @@ mod tests {
215215

216216
#[test]
217217
fn test_fixed_size_list() -> Result<()> {
218-
let v: Vec<i64> = (0..9).into_iter().collect();
218+
let v: Vec<i64> = (0..9).collect();
219219
let value_data = ArrayData::builder(DataType::Int64)
220220
.len(9)
221221
.add_buffer(Buffer::from_slice_ref(v))
@@ -240,7 +240,7 @@ mod tests {
240240
bit_util::set_bit(&mut validity_bits, 2);
241241
bit_util::set_bit(&mut validity_bits, 6);
242242

243-
let v: Vec<i16> = (0..16).into_iter().collect();
243+
let v: Vec<i16> = (0..16).collect();
244244
let value_data = ArrayData::builder(DataType::Int16)
245245
.len(16)
246246
.add_buffer(Buffer::from_slice_ref(v))
@@ -260,7 +260,7 @@ mod tests {
260260

261261
#[test]
262262
fn test_fixed_size_list_nested() -> Result<()> {
263-
let v: Vec<i32> = (0..16).into_iter().collect();
263+
let v: Vec<i32> = (0..16).collect();
264264
let value_data = ArrayData::builder(DataType::Int32)
265265
.len(16)
266266
.add_buffer(Buffer::from_slice_ref(v))

arrow/src/ffi.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -957,7 +957,7 @@ mod tests {
957957
let mut validity_bits: [u8; 1] = [0; 1];
958958
bit_util::set_bit(&mut validity_bits, 2);
959959

960-
let v: Vec<i32> = (0..9).into_iter().collect();
960+
let v: Vec<i32> = (0..9).collect();
961961
let value_data = ArrayData::builder(DataType::Int32)
962962
.len(9)
963963
.add_buffer(Buffer::from_slice_ref(&v))

arrow/tests/array_cast.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -428,7 +428,6 @@ fn get_all_types() -> Vec<DataType> {
428428
Dictionary(Box::new(key_type), Box::new(Decimal256(76, 0))),
429429
]
430430
})
431-
.into_iter()
432431
.collect::<Vec<_>>();
433432

434433
types.append(&mut dictionary_types);

parquet/src/arrow/async_reader/mod.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -622,7 +622,6 @@ impl<'a> InMemoryRowGroup<'a> {
622622
.iter()
623623
.zip(self.metadata.columns())
624624
.enumerate()
625-
.into_iter()
626625
.filter_map(|(idx, (chunk, chunk_meta))| {
627626
(chunk.is_none() && projection.leaf_included(idx)).then(|| {
628627
// If the first page does not start at the beginning of the column,
@@ -671,7 +670,6 @@ impl<'a> InMemoryRowGroup<'a> {
671670
.column_chunks
672671
.iter()
673672
.enumerate()
674-
.into_iter()
675673
.filter_map(|(idx, chunk)| {
676674
(chunk.is_none() && projection.leaf_included(idx)).then(|| {
677675
let column = self.metadata.column(idx);

0 commit comments

Comments
 (0)