Skip to content

Commit a894782

Browse files
committed
clippy issues
1 parent f169c57 commit a894782

17 files changed

+50
-57
lines changed

Cargo.toml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,20 +50,20 @@ regex = "1.11.1"
5050
ring = { version = "0.17.14", optional = true, default-features = false, features = ["alloc"] }
5151
serde = { version = "1.0.219", features = ["derive"] }
5252
serde_json = "1.0.140"
53-
sha2 = { version = "0.10.8", optional = true }
53+
sha2 = { version = "0.10.9", optional = true }
5454
urlencoding = "2.1.3"
5555
xmltree = "0.11.0"
5656
futures = "0.3.31"
5757
http = "1.3.1"
5858
thiserror = "2.0.12"
5959

6060
[dev-dependencies]
61-
tokio = { version = "1.46.1", features = ["full"] }
61+
tokio = { version = "1.47.1", features = ["full"] }
6262
minio_common = { path = "./common" }
6363
async-std = { version = "1.13.1", features = ["attributes", "tokio1"] }
64-
clap = { version = "4.5.41", features = ["derive"] }
64+
clap = { version = "4.5.44", features = ["derive"] }
6565
quickcheck = "1.0.3"
66-
criterion = "0.6.0"
66+
criterion = "0.7.0"
6767
minio-macros = { path = "./macros" }
6868

6969
[lib]

benches/s3/common_benches.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ pub(crate) fn benchmark_s3_api<ApiType, GlobalSetupFuture>(
169169
pub(crate) async fn skip_express_mode(bench_name: &str) -> bool {
170170
let skip = TestContext::new_from_env().client.is_minio_express().await;
171171
if skip {
172-
println!("Skipping benchmark '{}' (MinIO Express mode)", bench_name);
172+
println!("Skipping benchmark '{bench_name}' (MinIO Express mode)");
173173
}
174174
skip
175175
}

common/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ edition = "2024"
55

66
[dependencies]
77
minio = {path = ".." }
8-
tokio = { version = "1.46.1", features = ["full"] }
8+
tokio = { version = "1.47.1", features = ["full"] }
99
async-std = "1.13.1"
1010
rand = { version = "0.8.5", features = ["small_rng"] }
1111
bytes = "1.10.1"
@@ -14,7 +14,7 @@ chrono = "0.4.41"
1414
reqwest = "0.12.22"
1515
http = "1.3.1"
1616
futures = "0.3.31"
17-
uuid = { version = "1.17.0", features = ["v4"] }
17+
uuid = { version = "1.18.0", features = ["v4"] }
1818

1919
[lib]
2020
name = "minio_common"

examples/append_object.rs

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -57,23 +57,21 @@ async fn main() -> Result<(), Box<dyn std::error::Error + Send + Sync>> {
5757
offset_bytes += data_size;
5858
if resp.object_size() != offset_bytes {
5959
panic!(
60-
"from the append_object: size mismatch: expected {}, got {}",
60+
"from the append_object: size mismatch: expected {}, got {offset_bytes}",
6161
resp.object_size(),
62-
offset_bytes
6362
)
6463
}
65-
//println!("Append response: {:#?}", resp);
64+
//println!("Append response: {resp:#?}");
6665

6766
let resp: StatObjectResponse = client.stat_object(bucket_name, object_name).send().await?;
6867
if resp.size()? != offset_bytes {
6968
panic!(
70-
"from the stat_Object: size mismatch: expected {}, got {}",
69+
"from the stat_Object: size mismatch: expected {}, got {offset_bytes}",
7170
resp.size()?,
72-
offset_bytes
7371
)
7472
}
75-
println!("{}/{}", i, n_segments);
76-
//println!("Stat response: {:#?}", resp);
73+
println!("{i}/{n_segments}");
74+
//println!("Stat response: {resp:#?}");
7775
}
7876

7977
Ok(())

examples/bucket_encryption.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ async fn main() -> Result<(), Box<dyn std::error::Error + Send + Sync>> {
3333
log::info!("encryption before: config={:?}", resp.config());
3434

3535
let config = SseConfig::default();
36-
log::info!("going to set encryption config={:?}", config);
36+
log::info!("going to set encryption config={config:?}");
3737

3838
let _resp: PutBucketEncryptionResponse = client
3939
.put_bucket_encryption(bucket_name)

examples/bucket_lifecycle.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ async fn main() -> Result<(), Box<dyn std::error::Error + Send + Sync>> {
3535
// TODO
3636
let resp: GetBucketLifecycleResponse =
3737
client.get_bucket_lifecycle(bucket_name).send().await?;
38-
log::info!("life cycle settings before setting: resp={:?}", resp);
38+
log::info!("life cycle settings before setting: resp={resp:?}");
3939
}
4040

4141
let rules: Vec<LifecycleRule> = vec![LifecycleRule {
@@ -54,20 +54,20 @@ async fn main() -> Result<(), Box<dyn std::error::Error + Send + Sync>> {
5454
.life_cycle_config(LifecycleConfig { rules })
5555
.send()
5656
.await?;
57-
log::info!("response of setting life cycle config: resp={:?}", resp);
57+
log::info!("response of setting life cycle config: resp={resp:?}");
5858

5959
if false {
6060
// TODO
6161
let resp: GetBucketLifecycleResponse =
6262
client.get_bucket_lifecycle(bucket_name).send().await?;
63-
log::info!("life cycle settings after setting: resp={:?}", resp);
63+
log::info!("life cycle settings after setting: resp={resp:?}");
6464
}
6565

6666
if false {
6767
// TODO
6868
let resp: DeleteBucketLifecycleResponse =
6969
client.delete_bucket_lifecycle(bucket_name).send().await?;
70-
log::info!("response of deleting lifecycle config: resp={:?}", resp);
70+
log::info!("response of deleting lifecycle config: resp={resp:?}");
7171
}
7272
Ok(())
7373
}

examples/common.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ use minio::s3::{Client, ClientBuilder};
77
#[allow(dead_code)]
88
pub fn create_client_on_play() -> Result<Client, Box<dyn std::error::Error + Send + Sync>> {
99
let base_url = "https://play.min.io".parse::<BaseUrl>()?;
10-
log::info!("Trying to connect to MinIO at: `{:?}`", base_url);
10+
log::info!("Trying to connect to MinIO at: `{base_url:?}`");
1111

1212
let static_provider = StaticProvider::new(
1313
"Q3AM3UQ867SPQQA43P2F",
@@ -24,7 +24,7 @@ pub fn create_client_on_play() -> Result<Client, Box<dyn std::error::Error + Sen
2424
#[allow(dead_code)]
2525
pub fn create_client_on_localhost() -> Result<Client, Box<dyn std::error::Error + Send + Sync>> {
2626
let base_url = "http://localhost:9000/".parse::<BaseUrl>()?;
27-
log::info!("Trying to connect to MinIO at: `{:?}`", base_url);
27+
log::info!("Trying to connect to MinIO at: `{base_url:?}`");
2828

2929
let static_provider = StaticProvider::new("minioadmin", "minioadmin", None);
3030

examples/object_prompt.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ async fn main() -> Result<(), Box<dyn std::error::Error + Send + Sync>> {
3030

3131
//Note: object prompt is not supported on play.min.io, you will need point to AIStor
3232
let base_url = "http://localhost:9000".parse::<BaseUrl>()?;
33-
log::info!("Trying to connect to MinIO at: `{:?}`", base_url);
33+
log::info!("Trying to connect to MinIO at: `{base_url:?}`");
3434

3535
let static_provider = StaticProvider::new("admin", "admin", None);
3636

src/s3/builders/put_object.rs

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -534,7 +534,7 @@ impl ToS3Request for PutObject {
534534

535535
// region: put-object-content
536536

537-
/// PutObjectContent takes a `ObjectContent` stream and uploads it to MinIO/S3.
537+
/// PutObjectContent takes an `ObjectContent` stream and uploads it to MinIO/S3.
538538
///
539539
/// It is a higher level API and handles multipart uploads transparently.
540540
#[derive(Default)]
@@ -768,7 +768,7 @@ impl PutObjectContent {
768768
assert!(buffer_size <= part_size, "{buffer_size} <= {part_size}",);
769769

770770
if (buffer_size == 0) && (part_number > 1) {
771-
// We are done as we uploaded at least 1 part and we have reached the end of the stream.
771+
// We are done as we uploaded at least 1 part, and we have reached the end of the stream.
772772
break;
773773
}
774774

@@ -812,7 +812,7 @@ impl PutObjectContent {
812812
size: buffer_size,
813813
});
814814

815-
// Finally check if we are done.
815+
// Finally, check if we are done.
816816
if buffer_size < part_size {
817817
done = true;
818818
}
@@ -955,7 +955,7 @@ pub fn calc_part_info(
955955
}
956956

957957
match (object_size, part_size) {
958-
// If object size is unknown, part size must be provided.
958+
// If the object size is unknown, the part size must be provided.
959959
(Size::Unknown, Size::Unknown) => Err(ValidationErr::MissingPartSize),
960960

961961
// If object size is unknown, and part size is known, the number of
@@ -965,8 +965,7 @@ pub fn calc_part_info(
965965
// If object size is known, and part size is unknown, calculate part
966966
// size.
967967
(Size::Known(object_size), Size::Unknown) => {
968-
// 1. Calculate the minimum part size (i.e. assuming part count is
969-
// maximum).
968+
// 1. Calculate the minimum part size (i.e., assuming part count is the maximum).
970969
let mut psize: u64 = (object_size as f64 / MAX_MULTIPART_COUNT as f64).ceil() as u64;
971970

972971
// 2. Round up to the nearest multiple of MIN_PART_SIZE.
@@ -1024,14 +1023,14 @@ mod tests {
10241023
}
10251024
}
10261025
}
1027-
if let Size::Known(v) = object_size {
1028-
if v > MAX_OBJECT_SIZE {
1026+
if let Size::Known(v) = object_size
1027+
&& v > MAX_OBJECT_SIZE {
10291028
return match res {
10301029
Err(ValidationErr::InvalidObjectSize(v_err)) => v == v_err,
10311030
_ => false,
10321031
}
10331032
}
1034-
}
1033+
10351034

10361035
// Validate the calculation of part size and part count.
10371036
match (object_size, part_size, res) {

src/s3/minio_error_response.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -211,8 +211,7 @@ mod test_error_code {
211211
let code_obs: MinioErrorCode = str.parse().unwrap();
212212
assert_eq!(
213213
code_obs, *code,
214-
"Failed MinioErrorCode round-trip: code {} -> str '{}' -> code {}",
215-
code, str, code_obs
214+
"Failed MinioErrorCode round-trip: code {code} -> str '{str}' -> code {code_obs}"
216215
);
217216
}
218217
}

0 commit comments

Comments
 (0)