mirror of
https://github.com/langchain-ai/arrow-rs.git
synced 2026-07-01 21:34:01 -04:00
Fix Clippy in CI for Rust 1.87 release (#7514)
* Fix Clippy in CI for Rust 1.87 release * fmt * Allow * Add another allow
This commit is contained in:
@@ -485,6 +485,7 @@ impl<K: ArrowDictionaryKeyType> DictionaryArray<K> {
|
||||
|
||||
/// Returns `PrimitiveDictionaryBuilder` of this dictionary array for mutating
|
||||
/// its keys and values if the underlying data buffer is not shared by others.
|
||||
#[allow(clippy::result_large_err)]
|
||||
pub fn into_primitive_dict_builder<V>(self) -> Result<PrimitiveDictionaryBuilder<K, V>, Self>
|
||||
where
|
||||
V: ArrowPrimitiveType,
|
||||
@@ -541,6 +542,7 @@ impl<K: ArrowDictionaryKeyType> DictionaryArray<K> {
|
||||
/// assert_eq!(typed.value(1), 11);
|
||||
/// assert_eq!(typed.value(2), 21);
|
||||
/// ```
|
||||
#[allow(clippy::result_large_err)]
|
||||
pub fn unary_mut<F, V>(self, op: F) -> Result<DictionaryArray<K>, DictionaryArray<K>>
|
||||
where
|
||||
V: ArrowPrimitiveType,
|
||||
|
||||
@@ -112,6 +112,7 @@ static TABLES: Lazy<Vec<&'static str>> = Lazy::new(|| vec!["flight_sql.example.t
|
||||
pub struct FlightSqlServiceImpl {}
|
||||
|
||||
impl FlightSqlServiceImpl {
|
||||
#[allow(clippy::result_large_err)]
|
||||
fn check_token<T>(&self, req: &Request<T>) -> Result<(), Status> {
|
||||
let metadata = req.metadata();
|
||||
let auth = metadata.get("authorization").ok_or_else(|| {
|
||||
|
||||
@@ -76,7 +76,7 @@ pub async fn run_scenario(host: &str, port: u16) -> Result {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
#[allow(clippy::unnecessary_wraps)]
|
||||
#[allow(clippy::result_large_err)]
|
||||
fn middleware_interceptor(mut req: Request<()>) -> Result<Request<()>, Status> {
|
||||
let metadata = req.metadata_mut();
|
||||
metadata.insert("x-middleware", "expected value".parse().unwrap());
|
||||
|
||||
@@ -21,6 +21,7 @@ use memchr::memmem::Finder;
|
||||
use std::iter::zip;
|
||||
|
||||
/// A binary based predicate
|
||||
#[allow(clippy::large_enum_variant)]
|
||||
pub enum BinaryPredicate<'a> {
|
||||
Contains(Finder<'a>),
|
||||
StartsWith(&'a [u8]),
|
||||
|
||||
@@ -24,6 +24,7 @@ use regex::{Regex, RegexBuilder};
|
||||
use std::iter::zip;
|
||||
|
||||
/// A string based predicate
|
||||
#[allow(clippy::large_enum_variant)]
|
||||
pub(crate) enum Predicate<'a> {
|
||||
Eq(&'a str),
|
||||
Contains(Finder<'a>),
|
||||
|
||||
@@ -711,7 +711,7 @@ impl ReadTest {
|
||||
.schema_descr();
|
||||
|
||||
// Determine the correct selection ("ProjectionMask")
|
||||
let projection_mask = if projection_columns.iter().any(|&name| name == "*") {
|
||||
let projection_mask = if projection_columns.contains(&"*") {
|
||||
// * means all columns
|
||||
ProjectionMask::all()
|
||||
} else {
|
||||
|
||||
@@ -702,15 +702,11 @@ mod lz4_hadoop_codec {
|
||||
input_len -= PREFIX_LEN;
|
||||
|
||||
if input_len < expected_compressed_size as usize {
|
||||
return Err(io::Error::new(
|
||||
io::ErrorKind::Other,
|
||||
"Not enough bytes for Hadoop frame",
|
||||
));
|
||||
return Err(io::Error::other("Not enough bytes for Hadoop frame"));
|
||||
}
|
||||
|
||||
if output_len < expected_decompressed_size as usize {
|
||||
return Err(io::Error::new(
|
||||
io::ErrorKind::Other,
|
||||
return Err(io::Error::other(
|
||||
"Not enough bytes to hold advertised output",
|
||||
));
|
||||
}
|
||||
@@ -718,10 +714,7 @@ mod lz4_hadoop_codec {
|
||||
lz4_flex::decompress_into(&input[..expected_compressed_size as usize], output)
|
||||
.map_err(|e| ParquetError::External(Box::new(e)))?;
|
||||
if decompressed_size != expected_decompressed_size as usize {
|
||||
return Err(io::Error::new(
|
||||
io::ErrorKind::Other,
|
||||
"Unexpected decompressed size",
|
||||
));
|
||||
return Err(io::Error::other("Unexpected decompressed size"));
|
||||
}
|
||||
input_len -= expected_compressed_size as usize;
|
||||
output_len -= expected_decompressed_size as usize;
|
||||
@@ -736,10 +729,7 @@ mod lz4_hadoop_codec {
|
||||
if input_len == 0 {
|
||||
Ok(read_bytes)
|
||||
} else {
|
||||
Err(io::Error::new(
|
||||
io::ErrorKind::Other,
|
||||
"Not all input are consumed",
|
||||
))
|
||||
Err(io::Error::other("Not all input are consumed"))
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -147,7 +147,7 @@ pub type Result<T, E = ParquetError> = result::Result<T, E>;
|
||||
|
||||
impl From<ParquetError> for io::Error {
|
||||
fn from(e: ParquetError) -> Self {
|
||||
io::Error::new(io::ErrorKind::Other, e)
|
||||
io::Error::other(e)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user