Skip to content

Commit 63cb0d6

Browse files
mbrobbelSimon-3008-Simon
authored andcommitted
chore: fix clippy 1.88 warnings (apache#418)
1 parent 46ac149 commit 63cb0d6

File tree

14 files changed

+21
-21
lines changed

14 files changed

+21
-21
lines changed

src/aws/builder.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1586,7 +1586,7 @@ mod tests {
15861586
config_key
15871587
);
15881588
} else {
1589-
panic!("{} not propagated as ClientConfigKey", key);
1589+
panic!("{key} not propagated as ClientConfigKey");
15901590
}
15911591
}
15921592

@@ -1605,7 +1605,7 @@ mod tests {
16051605

16061606
let s3 = builder.build().expect("should build successfully");
16071607
let creds = &s3.client.config.credentials;
1608-
let debug_str = format!("{:?}", creds);
1608+
let debug_str = format!("{creds:?}");
16091609
assert!(
16101610
debug_str.contains("EKSPodCredentialProvider"),
16111611
"expected EKS provider but got: {debug_str}"

src/aws/client.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -374,7 +374,7 @@ impl Request<'_> {
374374
builder.header(CONTENT_TYPE, v.as_ref())
375375
}
376376
Attribute::Metadata(k_suffix) => builder.header(
377-
&format!("{}{}", USER_DEFINED_METADATA_HEADER_PREFIX, k_suffix),
377+
&format!("{USER_DEFINED_METADATA_HEADER_PREFIX}{k_suffix}"),
378378
v.as_ref(),
379379
),
380380
};

src/aws/credential.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1284,7 +1284,7 @@ mod tests {
12841284
token: Some("temp_token".to_string()),
12851285
};
12861286

1287-
let debug_output = format!("{:?}", cred);
1287+
let debug_output = format!("{cred:?}");
12881288

12891289
assert!(debug_output.contains("key_id: \"AKIAXXX\""));
12901290
assert!(debug_output.contains("secret_key: \"******\""));

src/aws/precondition.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ pub enum S3CopyIfNotExists {
6565
impl std::fmt::Display for S3CopyIfNotExists {
6666
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
6767
match self {
68-
Self::Header(k, v) => write!(f, "header: {}: {}", k, v),
68+
Self::Header(k, v) => write!(f, "header: {k}: {v}"),
6969
Self::HeaderWithStatus(k, v, code) => {
7070
write!(f, "header-with-status: {k}: {v}: {}", code.as_u16())
7171
}

src/aws/resolve.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ impl From<Error> for crate::Error {
4949
pub async fn resolve_bucket_region(bucket: &str, client_options: &ClientOptions) -> Result<String> {
5050
use reqwest::StatusCode;
5151

52-
let endpoint = format!("https://{}.s3.amazonaws.com", bucket);
52+
let endpoint = format!("https://{bucket}.s3.amazonaws.com");
5353

5454
let client = client_options.client()?;
5555

src/azure/builder.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1245,7 +1245,7 @@ mod tests {
12451245
config_key
12461246
);
12471247
} else {
1248-
panic!("{} not propagated as ClientConfigKey", key);
1248+
panic!("{key} not propagated as ClientConfigKey");
12491249
}
12501250
}
12511251
}

src/azure/client.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,7 @@ impl PutRequest<'_> {
243243
builder.header(&MS_CONTENT_TYPE, v.as_ref())
244244
}
245245
Attribute::Metadata(k_suffix) => builder.header(
246-
&format!("{}{}", USER_DEFINED_METADATA_HEADER_PREFIX, k_suffix),
246+
&format!("{USER_DEFINED_METADATA_HEADER_PREFIX}{k_suffix}"),
247247
v.as_ref(),
248248
),
249249
};
@@ -350,7 +350,7 @@ fn serialize_part_delete_request(
350350

351351
// Encode the subrequest request-line
352352
extend(dst, b"DELETE ");
353-
extend(dst, format!("/{} ", relative_url).as_bytes());
353+
extend(dst, format!("/{relative_url} ").as_bytes());
354354
extend(dst, b"HTTP/1.1");
355355
extend(dst, b"\r\n");
356356

@@ -716,7 +716,7 @@ impl AzureClient {
716716
.query(&[("restype", "container"), ("comp", "batch")])
717717
.header(
718718
CONTENT_TYPE,
719-
HeaderValue::from_str(format!("multipart/mixed; boundary={}", boundary).as_str())
719+
HeaderValue::from_str(format!("multipart/mixed; boundary={boundary}").as_str())
720720
.unwrap(),
721721
)
722722
.header(CONTENT_LENGTH, HeaderValue::from(body_bytes.len()))

src/azure/credential.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,7 @@ impl<'a> AzureAuthorizer<'a> {
261261
AzureCredential::BearerToken(token) => {
262262
request.headers_mut().append(
263263
AUTHORIZATION,
264-
HeaderValue::from_str(format!("Bearer {}", token).as_str()).unwrap(),
264+
HeaderValue::from_str(format!("Bearer {token}").as_str()).unwrap(),
265265
);
266266
}
267267
AzureCredential::SASToken(query_pairs) => {

src/client/builder.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ impl HttpRequestBuilder {
153153

154154
#[cfg(feature = "gcp")]
155155
pub(crate) fn bearer_auth(mut self, token: &str) -> Self {
156-
let value = HeaderValue::try_from(format!("Bearer {}", token));
156+
let value = HeaderValue::try_from(format!("Bearer {token}"));
157157
match (value, &mut self.request) {
158158
(Ok(mut v), Ok(r)) => {
159159
v.set_sensitive(true);

src/gcp/builder.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -733,7 +733,7 @@ mod tests {
733733
config_key
734734
);
735735
} else {
736-
panic!("{} not propagated as ClientConfigKey", key);
736+
panic!("{key} not propagated as ClientConfigKey");
737737
}
738738
}
739739
}

0 commit comments

Comments
 (0)