Skip to content

Commit 847534d

Browse files
authored
Fix Clippy in CI for Rust 1.87 release (#7514)
* Fix Clippy in CI for Rust 1.87 release * fmt * Allow * Add another allow
1 parent bf63e2a commit 847534d

File tree

8 files changed

+12
-17
lines changed

8 files changed

+12
-17
lines changed

arrow-array/src/array/dictionary_array.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -485,6 +485,7 @@ impl<K: ArrowDictionaryKeyType> DictionaryArray<K> {
485485

486486
/// Returns `PrimitiveDictionaryBuilder` of this dictionary array for mutating
487487
/// its keys and values if the underlying data buffer is not shared by others.
488+
#[allow(clippy::result_large_err)]
488489
pub fn into_primitive_dict_builder<V>(self) -> Result<PrimitiveDictionaryBuilder<K, V>, Self>
489490
where
490491
V: ArrowPrimitiveType,
@@ -541,6 +542,7 @@ impl<K: ArrowDictionaryKeyType> DictionaryArray<K> {
541542
/// assert_eq!(typed.value(1), 11);
542543
/// assert_eq!(typed.value(2), 21);
543544
/// ```
545+
#[allow(clippy::result_large_err)]
544546
pub fn unary_mut<F, V>(self, op: F) -> Result<DictionaryArray<K>, DictionaryArray<K>>
545547
where
546548
V: ArrowPrimitiveType,

arrow-flight/examples/flight_sql_server.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,7 @@ static TABLES: Lazy<Vec<&'static str>> = Lazy::new(|| vec!["flight_sql.example.t
112112
pub struct FlightSqlServiceImpl {}
113113

114114
impl FlightSqlServiceImpl {
115+
#[allow(clippy::result_large_err)]
115116
fn check_token<T>(&self, req: &Request<T>) -> Result<(), Status> {
116117
let metadata = req.metadata();
117118
let auth = metadata.get("authorization").ok_or_else(|| {

arrow-integration-testing/src/flight_client_scenarios/middleware.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ pub async fn run_scenario(host: &str, port: u16) -> Result {
7676
Ok(())
7777
}
7878

79-
#[allow(clippy::unnecessary_wraps)]
79+
#[allow(clippy::result_large_err)]
8080
fn middleware_interceptor(mut req: Request<()>) -> Result<Request<()>, Status> {
8181
let metadata = req.metadata_mut();
8282
metadata.insert("x-middleware", "expected value".parse().unwrap());

arrow-string/src/binary_predicate.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ use memchr::memmem::Finder;
2121
use std::iter::zip;
2222

2323
/// A binary based predicate
24+
#[allow(clippy::large_enum_variant)]
2425
pub enum BinaryPredicate<'a> {
2526
Contains(Finder<'a>),
2627
StartsWith(&'a [u8]),

arrow-string/src/predicate.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ use regex::{Regex, RegexBuilder};
2424
use std::iter::zip;
2525

2626
/// A string based predicate
27+
#[allow(clippy::large_enum_variant)]
2728
pub(crate) enum Predicate<'a> {
2829
Eq(&'a str),
2930
Contains(Finder<'a>),

parquet/benches/arrow_reader_clickbench.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -711,7 +711,7 @@ impl ReadTest {
711711
.schema_descr();
712712

713713
// Determine the correct selection ("ProjectionMask")
714-
let projection_mask = if projection_columns.iter().any(|&name| name == "*") {
714+
let projection_mask = if projection_columns.contains(&"*") {
715715
// * means all columns
716716
ProjectionMask::all()
717717
} else {

parquet/src/compression.rs

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -702,26 +702,19 @@ mod lz4_hadoop_codec {
702702
input_len -= PREFIX_LEN;
703703

704704
if input_len < expected_compressed_size as usize {
705-
return Err(io::Error::new(
706-
io::ErrorKind::Other,
707-
"Not enough bytes for Hadoop frame",
708-
));
705+
return Err(io::Error::other("Not enough bytes for Hadoop frame"));
709706
}
710707

711708
if output_len < expected_decompressed_size as usize {
712-
return Err(io::Error::new(
713-
io::ErrorKind::Other,
709+
return Err(io::Error::other(
714710
"Not enough bytes to hold advertised output",
715711
));
716712
}
717713
let decompressed_size =
718714
lz4_flex::decompress_into(&input[..expected_compressed_size as usize], output)
719715
.map_err(|e| ParquetError::External(Box::new(e)))?;
720716
if decompressed_size != expected_decompressed_size as usize {
721-
return Err(io::Error::new(
722-
io::ErrorKind::Other,
723-
"Unexpected decompressed size",
724-
));
717+
return Err(io::Error::other("Unexpected decompressed size"));
725718
}
726719
input_len -= expected_compressed_size as usize;
727720
output_len -= expected_decompressed_size as usize;
@@ -736,10 +729,7 @@ mod lz4_hadoop_codec {
736729
if input_len == 0 {
737730
Ok(read_bytes)
738731
} else {
739-
Err(io::Error::new(
740-
io::ErrorKind::Other,
741-
"Not all input are consumed",
742-
))
732+
Err(io::Error::other("Not all input are consumed"))
743733
}
744734
}
745735

parquet/src/errors.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ pub type Result<T, E = ParquetError> = result::Result<T, E>;
147147

148148
impl From<ParquetError> for io::Error {
149149
fn from(e: ParquetError) -> Self {
150-
io::Error::new(io::ErrorKind::Other, e)
150+
io::Error::other(e)
151151
}
152152
}
153153

0 commit comments

Comments
 (0)