From 1c26fea19fd474a6a1a7f24845c6ea71ceefc6e4 Mon Sep 17 00:00:00 2001 From: Vrishabh Date: Tue, 26 Nov 2024 01:11:21 +0530 Subject: [PATCH] fix clippy (#6791) --- arrow-ord/src/ord.rs | 2 +- object_store/src/aws/client.rs | 2 +- object_store/src/aws/dynamo.rs | 2 +- object_store/src/local.rs | 8 ++++++-- object_store/src/path/parts.rs | 2 +- 5 files changed, 10 insertions(+), 6 deletions(-) diff --git a/arrow-ord/src/ord.rs b/arrow-ord/src/ord.rs index 6430c8f0e405..9772e98bb3b9 100644 --- a/arrow-ord/src/ord.rs +++ b/arrow-ord/src/ord.rs @@ -394,7 +394,7 @@ pub fn make_comparator( } #[cfg(test)] -pub mod tests { +mod tests { use super::*; use arrow_array::builder::{Int32Builder, ListBuilder}; use arrow_buffer::{i256, IntervalDayTime, OffsetBuffer}; diff --git a/object_store/src/aws/client.rs b/object_store/src/aws/client.rs index 895308f5880e..82348b267c80 100644 --- a/object_store/src/aws/client.rs +++ b/object_store/src/aws/client.rs @@ -245,7 +245,7 @@ struct SessionCredential<'a> { config: &'a S3Config, } -impl<'a> SessionCredential<'a> { +impl SessionCredential<'_> { fn authorizer(&self) -> Option> { let mut authorizer = AwsAuthorizer::new(self.credential.as_deref()?, "s3", &self.config.region) diff --git a/object_store/src/aws/dynamo.rs b/object_store/src/aws/dynamo.rs index ece3b8a357c6..6283e76c1f87 100644 --- a/object_store/src/aws/dynamo.rs +++ b/object_store/src/aws/dynamo.rs @@ -471,7 +471,7 @@ enum ReturnValues { /// This provides cheap, ordered serialization of maps struct Map<'a, K, V>(&'a [(K, V)]); -impl<'a, K: Serialize, V: Serialize> Serialize for Map<'a, K, V> { +impl Serialize for Map<'_, K, V> { fn serialize(&self, serializer: S) -> Result where S: Serializer, diff --git a/object_store/src/local.rs b/object_store/src/local.rs index 11324b1e5b92..78fce9c26224 100644 --- a/object_store/src/local.rs +++ b/object_store/src/local.rs @@ -1004,7 +1004,7 @@ fn get_inode(metadata: &Metadata) -> u64 { #[cfg(not(unix))] /// On platforms where an inode isn't available, fallback to just relying on size and mtime -fn get_inode(metadata: &Metadata) -> u64 { +fn get_inode(_metadata: &Metadata) -> u64 { 0 } @@ -1060,7 +1060,10 @@ mod tests { use std::fs; use futures::TryStreamExt; - use tempfile::{NamedTempFile, TempDir}; + use tempfile::TempDir; + + #[cfg(target_family = "unix")] + use tempfile::NamedTempFile; use crate::integration::*; @@ -1248,6 +1251,7 @@ mod tests { fs.list_with_delimiter(None).await.unwrap(); } + #[cfg(target_family = "unix")] async fn check_list(integration: &LocalFileSystem, prefix: Option<&Path>, expected: &[&str]) { let result: Vec<_> = integration.list(prefix).try_collect().await.unwrap(); diff --git a/object_store/src/path/parts.rs b/object_store/src/path/parts.rs index df7097cbe9db..de2e1a75c955 100644 --- a/object_store/src/path/parts.rs +++ b/object_store/src/path/parts.rs @@ -126,7 +126,7 @@ impl From for PathPart<'static> { } } -impl<'a> AsRef for PathPart<'a> { +impl AsRef for PathPart<'_> { fn as_ref(&self) -> &str { self.raw.as_ref() }