This is an automated email from the ASF dual-hosted git repository.
alamb pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/arrow-rs.git
The following commit(s) were added to refs/heads/master by this push:
new 3715d5447e4 new clippy rules (#5881)
3715d5447e4 is described below
commit 3715d5447e468a5a4dc631ae9aafec706c57aa20
Author: Xiangpeng Hao <[email protected]>
AuthorDate: Thu Jun 13 11:44:55 2024 -0400
new clippy rules (#5881)
---
arrow-data/src/data.rs | 2 +-
arrow-ipc/src/writer.rs | 2 +-
arrow-json/src/reader/mod.rs | 8 ++---
parquet/src/column/reader.rs | 68 +++++++++++++++++++--------------------
parquet/src/encodings/decoding.rs | 16 ++++-----
parquet_derive_test/src/lib.rs | 6 ++--
6 files changed, 51 insertions(+), 51 deletions(-)
diff --git a/arrow-data/src/data.rs b/arrow-data/src/data.rs
index 5ee96639488..12fe4968d5a 100644
--- a/arrow-data/src/data.rs
+++ b/arrow-data/src/data.rs
@@ -24,9 +24,9 @@ use arrow_buffer::{
bit_util, i256, ArrowNativeType, Buffer, IntervalDayTime,
IntervalMonthDayNano, MutableBuffer,
};
use arrow_schema::{ArrowError, DataType, UnionMode};
+use std::mem;
use std::ops::Range;
use std::sync::Arc;
-use std::{mem, usize};
use crate::{equal, validate_binary_view, validate_string_view};
diff --git a/arrow-ipc/src/writer.rs b/arrow-ipc/src/writer.rs
index ef08a6130e3..f74a86e013c 100644
--- a/arrow-ipc/src/writer.rs
+++ b/arrow-ipc/src/writer.rs
@@ -1742,7 +1742,7 @@ mod tests {
let array1 = NullArray::new(32);
let array2 = Int32Array::from(vec![1; 32]);
let array3 = NullArray::new(32);
- let array4 = Float64Array::from(vec![std::f64::NAN; 32]);
+ let array4 = Float64Array::from(vec![f64::NAN; 32]);
let batch = RecordBatch::try_new(
Arc::new(schema.clone()),
vec![
diff --git a/arrow-json/src/reader/mod.rs b/arrow-json/src/reader/mod.rs
index 9a113ee2bd7..0a50cfac65f 100644
--- a/arrow-json/src/reader/mod.rs
+++ b/arrow-json/src/reader/mod.rs
@@ -2282,8 +2282,8 @@ mod tests {
fn test_coercing_primitive_into_string_decoder() {
let buf = &format!(
r#"[{{"a": 1, "b": "A", "c": "T"}}, {{"a": 2, "b": "BB", "c":
"F"}}, {{"a": {}, "b": 123, "c": false}}, {{"a": {}, "b": 789, "c": true}}]"#,
- (std::i32::MAX as i64 + 10),
- std::i64::MAX - 10
+ (i32::MAX as i64 + 10),
+ i64::MAX - 10
);
let schema = Schema::new(vec![
Field::new("a", DataType::Float64, true),
@@ -2306,8 +2306,8 @@ mod tests {
Arc::new(Float64Array::from(vec![
1.0,
2.0,
- (std::i32::MAX as i64 + 10) as f64,
- (std::i64::MAX - 10) as f64
+ (i32::MAX as i64 + 10) as f64,
+ (i64::MAX - 10) as f64
])),
Arc::new(StringArray::from(vec!["A", "BB", "123", "789"])),
Arc::new(StringArray::from(vec!["T", "F", "false",
"true"])),
diff --git a/parquet/src/column/reader.rs b/parquet/src/column/reader.rs
index 53d56dd6b9f..b40ca2b7829 100644
--- a/parquet/src/column/reader.rs
+++ b/parquet/src/column/reader.rs
@@ -672,8 +672,8 @@ mod tests {
NUM_PAGES,
NUM_LEVELS,
16,
- std::i32::MIN,
- std::i32::MAX
+ i32::MIN,
+ i32::MAX
);
test!(
test_read_plain_v2_int32,
@@ -684,8 +684,8 @@ mod tests {
NUM_PAGES,
NUM_LEVELS,
16,
- std::i32::MIN,
- std::i32::MAX
+ i32::MIN,
+ i32::MAX
);
test!(
@@ -697,8 +697,8 @@ mod tests {
NUM_PAGES,
NUM_LEVELS,
17,
- std::i32::MIN,
- std::i32::MAX
+ i32::MIN,
+ i32::MAX
);
test!(
test_read_plain_v2_int32_uneven,
@@ -709,8 +709,8 @@ mod tests {
NUM_PAGES,
NUM_LEVELS,
17,
- std::i32::MIN,
- std::i32::MAX
+ i32::MIN,
+ i32::MAX
);
test!(
@@ -722,8 +722,8 @@ mod tests {
NUM_PAGES,
NUM_LEVELS,
512,
- std::i32::MIN,
- std::i32::MAX
+ i32::MIN,
+ i32::MAX
);
test!(
test_read_plain_v2_int32_multi_page,
@@ -734,8 +734,8 @@ mod tests {
NUM_PAGES,
NUM_LEVELS,
512,
- std::i32::MIN,
- std::i32::MAX
+ i32::MIN,
+ i32::MAX
);
// test cases when column descriptor has MAX_DEF_LEVEL = 0 and
MAX_REP_LEVEL = 0
@@ -748,8 +748,8 @@ mod tests {
NUM_PAGES,
NUM_LEVELS,
16,
- std::i32::MIN,
- std::i32::MAX
+ i32::MIN,
+ i32::MAX
);
test!(
test_read_plain_v2_int32_required_non_repeated,
@@ -760,8 +760,8 @@ mod tests {
NUM_PAGES,
NUM_LEVELS,
16,
- std::i32::MIN,
- std::i32::MAX
+ i32::MIN,
+ i32::MAX
);
test!(
@@ -773,8 +773,8 @@ mod tests {
NUM_PAGES,
NUM_LEVELS,
16,
- std::i64::MIN,
- std::i64::MAX
+ i64::MIN,
+ i64::MAX
);
test!(
test_read_plain_v2_int64,
@@ -785,8 +785,8 @@ mod tests {
NUM_PAGES,
NUM_LEVELS,
16,
- std::i64::MIN,
- std::i64::MAX
+ i64::MIN,
+ i64::MAX
);
test!(
@@ -798,8 +798,8 @@ mod tests {
NUM_PAGES,
NUM_LEVELS,
17,
- std::i64::MIN,
- std::i64::MAX
+ i64::MIN,
+ i64::MAX
);
test!(
test_read_plain_v2_int64_uneven,
@@ -810,8 +810,8 @@ mod tests {
NUM_PAGES,
NUM_LEVELS,
17,
- std::i64::MIN,
- std::i64::MAX
+ i64::MIN,
+ i64::MAX
);
test!(
@@ -823,8 +823,8 @@ mod tests {
NUM_PAGES,
NUM_LEVELS,
512,
- std::i64::MIN,
- std::i64::MAX
+ i64::MIN,
+ i64::MAX
);
test!(
test_read_plain_v2_int64_multi_page,
@@ -835,8 +835,8 @@ mod tests {
NUM_PAGES,
NUM_LEVELS,
512,
- std::i64::MIN,
- std::i64::MAX
+ i64::MIN,
+ i64::MAX
);
// test cases when column descriptor has MAX_DEF_LEVEL = 0 and
MAX_REP_LEVEL = 0
@@ -849,8 +849,8 @@ mod tests {
NUM_PAGES,
NUM_LEVELS,
16,
- std::i64::MIN,
- std::i64::MAX
+ i64::MIN,
+ i64::MAX
);
test!(
test_read_plain_v2_int64_required_non_repeated,
@@ -861,8 +861,8 @@ mod tests {
NUM_PAGES,
NUM_LEVELS,
16,
- std::i64::MIN,
- std::i64::MAX
+ i64::MIN,
+ i64::MAX
);
test!(
@@ -1037,8 +1037,8 @@ mod tests {
num_pages,
num_levels,
batch_size,
- std::i32::MIN,
- std::i32::MAX,
+ i32::MIN,
+ i32::MAX,
false,
);
}
diff --git a/parquet/src/encodings/decoding.rs
b/parquet/src/encodings/decoding.rs
index a1924f72e85..b3dd1352379 100644
--- a/parquet/src/encodings/decoding.rs
+++ b/parquet/src/encodings/decoding.rs
@@ -1624,14 +1624,14 @@ mod tests {
#[test]
fn test_delta_bit_packed_int64_min_max() {
let block_data = vec![
- i64::min_value(),
- i64::max_value(),
- i64::min_value(),
- i64::max_value(),
- i64::min_value(),
- i64::max_value(),
- i64::min_value(),
- i64::max_value(),
+ i64::MIN,
+ i64::MAX,
+ i64::MIN,
+ i64::MAX,
+ i64::MIN,
+ i64::MAX,
+ i64::MIN,
+ i64::MAX,
];
test_delta_bit_packed_decode::<Int64Type>(vec![block_data]);
}
diff --git a/parquet_derive_test/src/lib.rs b/parquet_derive_test/src/lib.rs
index 3743c6b55c7..b8e6c27f53c 100644
--- a/parquet_derive_test/src/lib.rs
+++ b/parquet_derive_test/src/lib.rs
@@ -141,9 +141,9 @@ mod tests {
maybe_usize: Some(4456),
isize: -365,
float: 3.5,
- double: std::f64::NAN,
+ double: f64::NAN,
maybe_float: None,
- maybe_double: Some(std::f64::MAX),
+ maybe_double: Some(f64::MAX),
borrowed_maybe_a_string: &maybe_a_string,
borrowed_maybe_a_str: &maybe_a_str,
now: chrono::Utc::now().naive_local(),
@@ -180,7 +180,7 @@ mod tests {
u64: 4563424,
isize: -365,
float: 3.5,
- double: std::f64::NAN,
+ double: f64::NAN,
now: chrono::Utc::now().naive_local(),
date: chrono::naive::NaiveDate::from_ymd_opt(2015, 3, 14).unwrap(),
uuid: uuid::Uuid::new_v4(),