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-object-store.git
The following commit(s) were added to refs/heads/main by this push:
new 8435bec chore: fix clippy 1.88 warnings (#418)
8435bec is described below
commit 8435bec092a35cadfaedb949e73f237fe23e8a92
Author: Matthijs Brobbel <[email protected]>
AuthorDate: Mon Jun 30 17:21:53 2025 +0200
chore: fix clippy 1.88 warnings (#418)
---
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 f271233..ab50aa5 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 464c143..a99db15 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 60cc6a4..7e2681d 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 449536d..52ecb9f 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 db899ea..66d1511 100644
--- a/src/aws/resolve.rs
+++ b/src/aws/resolve.rs
@@ -49,7 +49,7 @@ impl From<Error> for crate::Error {
pub async fn resolve_bucket_region(bucket: &str, client_options:
&ClientOptions) -> Result<String> {
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 b462065..e97e83e 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 6a9d38c..c7440a0 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 27f8776..c34a8e3 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 fe2aad9..f74c5ec 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 87e28d5..f7607ee 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 bd365ca..a988cc4 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 1d224fd..bd77fed 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 dc2e2d1..3404bc8 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 8f40871..dec642a 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;