Fix cargo clippy issues
Some checks reported errors
continuous-integration/drone/push Build encountered an error

This commit is contained in:
2025-07-03 08:05:56 +02:00
parent c0b4154e67
commit 76e7bc8c46
2 changed files with 32 additions and 8 deletions

View File

@ -4,17 +4,37 @@ type: docker
name: default
steps:
- name: cargo_check
- name: fetch_dependencies
image: rust
volumes:
- name: rust_registry
path: /usr/local/cargo/registry
commands:
- cargo fetch
- name: code_quality
image: rust
volumes:
- name: rust_registry
path: /usr/local/cargo/registry
depends_on:
- fetch_dependencies
commands:
- rustup component add clippy
- cargo clippy -- -D warnings
- name: test
image: rust
volumes:
- name: rust_registry
path: /usr/local/cargo/registry
commands:
- wget -O /usr/bin/minio https://dl.min.io/server/minio/release/linux-amd64/minio
- wget -O /usr/bin/mc https://dl.min.io/client/mc/release/linux-amd64/mc
- chmod +x /usr/bin/minio /usr/bin/mc
- rustup component add clippy
- cargo clippy -- -D warnings
- cargo test
- name: doc
- name: build_doc
image: python
environment:
AWS_ACCESS_KEY_ID:
@ -39,3 +59,7 @@ steps:
- aws configure set default.s3.signature_version s3v4
# Upload to bucket
- cd public && aws --endpoint-url https://s3.communiquons.org s3 sync . s3://miniok8sbucketsoperator-website
volumes:
- name: rust_registry
temp: {}

View File

@ -164,7 +164,7 @@ impl MinioService {
/// Get bucket name prefixed by mc alias name
fn absolute_bucket_name(&self, name: &str) -> String {
format!("{}/{name}", MC_ALIAS_NAME)
format!("{MC_ALIAS_NAME}/{name}")
}
/// Execute a minio mc command
@ -172,7 +172,7 @@ impl MinioService {
where
A: DeserializeOwned,
{
log::debug!("exec_mc_cmd with args {:?}", args);
log::debug!("exec_mc_cmd with args {args:?}");
let conf_dir = temp::create_temp_dir()?;
let global_flags = ["--config-dir", conf_dir.to_str().unwrap(), "--json"];
@ -354,7 +354,7 @@ impl MinioService {
let bucket_name = self.absolute_bucket_name(bucket);
let res = if let Some(quota) = &quota {
let quota = format!("{}B", quota);
let quota = format!("{quota}B");
self.exec_mc_cmd::<BasicMinioResult>(&[
"quota",
"set",
@ -447,7 +447,7 @@ impl MinioService {
"governance" => RetentionType::Governance,
"compliance" => RetentionType::Compliance,
o => {
log::error!("Unknown retention type: {}", o);
log::error!("Unknown retention type: {o}");
return Ok(None);
}
},