Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/aws/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1586,7 +1586,7 @@ mod tests {
config_key
);
} else {
panic!("{} not propagated as ClientConfigKey", key);
panic!("{key} not propagated as ClientConfigKey");
}
}

Expand All @@ -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}"
Expand Down
2 changes: 1 addition & 1 deletion src/aws/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
),
};
Expand Down
2 changes: 1 addition & 1 deletion src/aws/credential.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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: \"******\""));
Expand Down
2 changes: 1 addition & 1 deletion src/aws/precondition.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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())
}
Expand Down
2 changes: 1 addition & 1 deletion src/aws/resolve.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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()?;

Expand Down
2 changes: 1 addition & 1 deletion src/azure/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1245,7 +1245,7 @@ mod tests {
config_key
);
} else {
panic!("{} not propagated as ClientConfigKey", key);
panic!("{key} not propagated as ClientConfigKey");
}
}
}
6 changes: 3 additions & 3 deletions src/azure/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
),
};
Expand Down Expand Up @@ -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");

Expand Down Expand Up @@ -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()))
Expand Down
2 changes: 1 addition & 1 deletion src/azure/credential.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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) => {
Expand Down
2 changes: 1 addition & 1 deletion src/client/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion src/gcp/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -733,7 +733,7 @@ mod tests {
config_key
);
} else {
panic!("{} not propagated as ClientConfigKey", key);
panic!("{key} not propagated as ClientConfigKey");
}
}
}
5 changes: 2 additions & 3 deletions src/gcp/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
),
};
Expand Down Expand Up @@ -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
Expand Down
5 changes: 2 additions & 3 deletions src/gcp/credential.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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());
Expand Down Expand Up @@ -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}"
)
}

Expand Down
2 changes: 1 addition & 1 deletion src/local.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
Expand Down
4 changes: 3 additions & 1 deletion src/throttle.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down