You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@arrow.apache.org by tu...@apache.org on 2024/11/25 19:41:28 UTC

(arrow-rs) branch main updated: fix clippy (#6791)

This is an automated email from the ASF dual-hosted git repository.

tustvold pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/arrow-rs.git


The following commit(s) were added to refs/heads/main by this push:
     new ccd18f203 fix clippy (#6791)
ccd18f203 is described below

commit ccd18f203116e87675ea4ddaf5ddc1b4f986ad14
Author: Vrishabh <ps...@gmail.com>
AuthorDate: Tue Nov 26 01:11:21 2024 +0530

    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 +-
 parquet/src/arrow/async_reader/mod.rs | 2 +-
 parquet/src/arrow/async_writer/mod.rs | 2 +-
 7 files changed, 12 insertions(+), 8 deletions(-)

diff --git a/arrow-ord/src/ord.rs b/arrow-ord/src/ord.rs
index 547422b40..55e397cd8 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 b19e0e2ab..51c917723 100644
--- a/object_store/src/aws/client.rs
+++ b/object_store/src/aws/client.rs
@@ -246,7 +246,7 @@ struct SessionCredential<'a> {
     config: &'a S3Config,
 }
 
-impl<'a> SessionCredential<'a> {
+impl SessionCredential<'_> {
     fn authorizer(&self) -> Option<AwsAuthorizer<'_>> {
         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 ece3b8a35..6283e76c1 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<K: Serialize, V: Serialize> Serialize for Map<'_, K, V> {
     fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
     where
         S: Serializer,
diff --git a/object_store/src/local.rs b/object_store/src/local.rs
index 11324b1e5..78fce9c26 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 df7097cbe..de2e1a75c 100644
--- a/object_store/src/path/parts.rs
+++ b/object_store/src/path/parts.rs
@@ -126,7 +126,7 @@ impl From<String> for PathPart<'static> {
     }
 }
 
-impl<'a> AsRef<str> for PathPart<'a> {
+impl AsRef<str> for PathPart<'_> {
     fn as_ref(&self) -> &str {
         self.raw.as_ref()
     }
diff --git a/parquet/src/arrow/async_reader/mod.rs b/parquet/src/arrow/async_reader/mod.rs
index aaa60fc59..c408456df 100644
--- a/parquet/src/arrow/async_reader/mod.rs
+++ b/parquet/src/arrow/async_reader/mod.rs
@@ -159,7 +159,7 @@ pub trait AsyncFileReader: Send {
 }
 
 /// This allows Box<dyn AsyncFileReader + '_> to be used as an AsyncFileReader,
-impl<'reader> AsyncFileReader for Box<dyn AsyncFileReader + 'reader> {
+impl AsyncFileReader for Box<dyn AsyncFileReader + '_> {
     fn get_bytes(&mut self, range: Range<usize>) -> BoxFuture<'_, Result<Bytes>> {
         self.as_mut().get_bytes(range)
     }
diff --git a/parquet/src/arrow/async_writer/mod.rs b/parquet/src/arrow/async_writer/mod.rs
index 5695fd216..c04d5710a 100644
--- a/parquet/src/arrow/async_writer/mod.rs
+++ b/parquet/src/arrow/async_writer/mod.rs
@@ -89,7 +89,7 @@ pub trait AsyncFileWriter: Send {
     fn complete(&mut self) -> BoxFuture<'_, Result<()>>;
 }
 
-impl<'writer> AsyncFileWriter for Box<dyn AsyncFileWriter + 'writer> {
+impl AsyncFileWriter for Box<dyn AsyncFileWriter + '_> {
     fn write(&mut self, bs: Bytes) -> BoxFuture<'_, Result<()>> {
         self.as_mut().write(bs)
     }