From 7b423d69665259c26cb5856fdbbac3ec9fc1ef09 Mon Sep 17 00:00:00 2001 From: Matthijs Brobbel Date: Mon, 30 Jun 2025 14:03:45 +0200 Subject: [PATCH] chore: fix clippy 1.88 warnings --- src/aws/builder.rs | 4 ++-- src/aws/client.rs | 2 +- src/aws/credential.rs | 2 +- src/aws/precondition.rs | 2 +- src/aws/resolve.rs | 2 +- src/azure/builder.rs | 2 +- src/azure/client.rs | 6 +++--- src/azure/credential.rs | 2 +- src/client/builder.rs | 2 +- src/gcp/builder.rs | 2 +- src/gcp/client.rs | 5 ++--- src/gcp/credential.rs | 5 ++--- src/local.rs | 2 +- src/throttle.rs | 4 +++- 14 files changed, 21 insertions(+), 21 deletions(-) diff --git a/src/aws/builder.rs b/src/aws/builder.rs index f2712333..ab50aa5d 100644 --- a/src/aws/builder.rs +++ b/src/aws/builder.rs @@ -1586,7 +1586,7 @@ mod tests { config_key ); } else { - panic!("{} not propagated as ClientConfigKey", key); + panic!("{key} not propagated as ClientConfigKey"); } } @@ -1605,7 +1605,7 @@ mod tests { let s3 = builder.build().expect("should build successfully"); let creds = &s3.client.config.credentials; - let debug_str = format!("{:?}", creds); + let debug_str = format!("{creds:?}"); assert!( debug_str.contains("EKSPodCredentialProvider"), "expected EKS provider but got: {debug_str}" diff --git a/src/aws/client.rs b/src/aws/client.rs index 464c1436..a99db159 100644 --- a/src/aws/client.rs +++ b/src/aws/client.rs @@ -374,7 +374,7 @@ impl Request<'_> { builder.header(CONTENT_TYPE, v.as_ref()) } Attribute::Metadata(k_suffix) => builder.header( - &format!("{}{}", USER_DEFINED_METADATA_HEADER_PREFIX, k_suffix), + &format!("{USER_DEFINED_METADATA_HEADER_PREFIX}{k_suffix}"), v.as_ref(), ), }; diff --git a/src/aws/credential.rs b/src/aws/credential.rs index 60cc6a4b..7e2681d4 100644 --- a/src/aws/credential.rs +++ b/src/aws/credential.rs @@ -1284,7 +1284,7 @@ mod tests { token: Some("temp_token".to_string()), }; - let debug_output = format!("{:?}", cred); + let debug_output = format!("{cred:?}"); assert!(debug_output.contains("key_id: \"AKIAXXX\"")); assert!(debug_output.contains("secret_key: \"******\"")); diff --git a/src/aws/precondition.rs b/src/aws/precondition.rs index 449536d1..52ecb9f3 100644 --- a/src/aws/precondition.rs +++ b/src/aws/precondition.rs @@ -65,7 +65,7 @@ pub enum S3CopyIfNotExists { impl std::fmt::Display for S3CopyIfNotExists { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { match self { - Self::Header(k, v) => write!(f, "header: {}: {}", k, v), + Self::Header(k, v) => write!(f, "header: {k}: {v}"), Self::HeaderWithStatus(k, v, code) => { write!(f, "header-with-status: {k}: {v}: {}", code.as_u16()) } diff --git a/src/aws/resolve.rs b/src/aws/resolve.rs index db899ea9..66d1511c 100644 --- a/src/aws/resolve.rs +++ b/src/aws/resolve.rs @@ -49,7 +49,7 @@ impl From for crate::Error { pub async fn resolve_bucket_region(bucket: &str, client_options: &ClientOptions) -> Result { use reqwest::StatusCode; - let endpoint = format!("https://{}.s3.amazonaws.com", bucket); + let endpoint = format!("https://{bucket}.s3.amazonaws.com"); let client = client_options.client()?; diff --git a/src/azure/builder.rs b/src/azure/builder.rs index b4620654..e97e83e6 100644 --- a/src/azure/builder.rs +++ b/src/azure/builder.rs @@ -1245,7 +1245,7 @@ mod tests { config_key ); } else { - panic!("{} not propagated as ClientConfigKey", key); + panic!("{key} not propagated as ClientConfigKey"); } } } diff --git a/src/azure/client.rs b/src/azure/client.rs index 6a9d38c3..c7440a07 100644 --- a/src/azure/client.rs +++ b/src/azure/client.rs @@ -243,7 +243,7 @@ impl PutRequest<'_> { builder.header(&MS_CONTENT_TYPE, v.as_ref()) } Attribute::Metadata(k_suffix) => builder.header( - &format!("{}{}", USER_DEFINED_METADATA_HEADER_PREFIX, k_suffix), + &format!("{USER_DEFINED_METADATA_HEADER_PREFIX}{k_suffix}"), v.as_ref(), ), }; @@ -350,7 +350,7 @@ fn serialize_part_delete_request( // Encode the subrequest request-line extend(dst, b"DELETE "); - extend(dst, format!("/{} ", relative_url).as_bytes()); + extend(dst, format!("/{relative_url} ").as_bytes()); extend(dst, b"HTTP/1.1"); extend(dst, b"\r\n"); @@ -716,7 +716,7 @@ impl AzureClient { .query(&[("restype", "container"), ("comp", "batch")]) .header( CONTENT_TYPE, - HeaderValue::from_str(format!("multipart/mixed; boundary={}", boundary).as_str()) + HeaderValue::from_str(format!("multipart/mixed; boundary={boundary}").as_str()) .unwrap(), ) .header(CONTENT_LENGTH, HeaderValue::from(body_bytes.len())) diff --git a/src/azure/credential.rs b/src/azure/credential.rs index 27f8776b..c34a8e3c 100644 --- a/src/azure/credential.rs +++ b/src/azure/credential.rs @@ -261,7 +261,7 @@ impl<'a> AzureAuthorizer<'a> { AzureCredential::BearerToken(token) => { request.headers_mut().append( AUTHORIZATION, - HeaderValue::from_str(format!("Bearer {}", token).as_str()).unwrap(), + HeaderValue::from_str(format!("Bearer {token}").as_str()).unwrap(), ); } AzureCredential::SASToken(query_pairs) => { diff --git a/src/client/builder.rs b/src/client/builder.rs index fe2aad98..f74c5ec1 100644 --- a/src/client/builder.rs +++ b/src/client/builder.rs @@ -153,7 +153,7 @@ impl HttpRequestBuilder { #[cfg(feature = "gcp")] pub(crate) fn bearer_auth(mut self, token: &str) -> Self { - let value = HeaderValue::try_from(format!("Bearer {}", token)); + let value = HeaderValue::try_from(format!("Bearer {token}")); match (value, &mut self.request) { (Ok(mut v), Ok(r)) => { v.set_sensitive(true); diff --git a/src/gcp/builder.rs b/src/gcp/builder.rs index 87e28d5a..f7607eea 100644 --- a/src/gcp/builder.rs +++ b/src/gcp/builder.rs @@ -733,7 +733,7 @@ mod tests { config_key ); } else { - panic!("{} not propagated as ClientConfigKey", key); + panic!("{key} not propagated as ClientConfigKey"); } } } diff --git a/src/gcp/client.rs b/src/gcp/client.rs index bd365ca5..a988cc45 100644 --- a/src/gcp/client.rs +++ b/src/gcp/client.rs @@ -202,7 +202,7 @@ impl Request<'_> { builder.header(CONTENT_TYPE, v.as_ref()) } Attribute::Metadata(k_suffix) => builder.header( - &format!("{}{}", USER_DEFINED_METADATA_HEADER_PREFIX, k_suffix), + &format!("{USER_DEFINED_METADATA_HEADER_PREFIX}{k_suffix}"), v.as_ref(), ), }; @@ -327,8 +327,7 @@ impl GoogleCloudStorageClient { }; let url = format!( - "https://iamcredentials.googleapis.com/v1/projects/-/serviceAccounts/{}:signBlob", - client_email + "https://iamcredentials.googleapis.com/v1/projects/-/serviceAccounts/{client_email}:signBlob" ); let response = self diff --git a/src/gcp/credential.rs b/src/gcp/credential.rs index 1d224fdd..bd77fedc 100644 --- a/src/gcp/credential.rs +++ b/src/gcp/credential.rs @@ -769,7 +769,7 @@ impl GCSAuthorizer { let email = &self.credential.email; let date = self.date.unwrap_or_else(Utc::now); let scope = self.scope(date); - let credential_with_scope = format!("{}/{}", email, scope); + let credential_with_scope = format!("{email}/{scope}"); let mut headers = HeaderMap::new(); headers.insert("host", DEFAULT_GCS_SIGN_BLOB_HOST.parse().unwrap()); @@ -821,8 +821,7 @@ impl GCSAuthorizer { let (canonical_headers, signed_headers) = Self::canonicalize_headers(headers); format!( - "{}\n{}\n{}\n{}\n\n{}\n{}", - verb, path, query, canonical_headers, signed_headers, DEFAULT_GCS_PLAYLOAD_STRING + "{verb}\n{path}\n{query}\n{canonical_headers}\n\n{signed_headers}\n{DEFAULT_GCS_PLAYLOAD_STRING}" ) } diff --git a/src/local.rs b/src/local.rs index dc2e2d10..3404bc89 100644 --- a/src/local.rs +++ b/src/local.rs @@ -1498,7 +1498,7 @@ mod tests { let root_path = root.path(); for i in 0..5 { - let filename = format!("test{}.parquet", i); + let filename = format!("test{i}.parquet"); let file = root_path.join(filename); std::fs::write(file, "test").unwrap(); } diff --git a/src/throttle.rs b/src/throttle.rs index 8f40871c..dec642a7 100644 --- a/src/throttle.rs +++ b/src/throttle.rs @@ -404,7 +404,9 @@ impl MultipartUpload for ThrottledUpload { #[cfg(test)] mod tests { use super::*; - use crate::{integration::*, memory::InMemory, GetResultPayload}; + #[cfg(target_os = "linux")] + use crate::GetResultPayload; + use crate::{integration::*, memory::InMemory}; use futures::TryStreamExt; use tokio::time::Duration; use tokio::time::Instant;