fix: replace Arc<Box<...>> credential-provider with Arc<...> (#164)

* replace Arc<Box<...>> provider with Arc<...>
* remove need for caller to Box provider
This commit is contained in:
Tobias Pütz
2025-06-16 14:48:16 +02:00
committed by GitHub
parent 7d0fcaa5a4
commit e53e151e3e
5 changed files with 14 additions and 17 deletions

View File

@@ -16,7 +16,7 @@ pub fn create_client_on_play() -> Result<Client, Box<dyn std::error::Error + Sen
);
let client = ClientBuilder::new(base_url.clone())
.provider(Some(Box::new(static_provider)))
.provider(Some(static_provider))
.build()?;
Ok(client)
}
@@ -29,7 +29,7 @@ pub fn create_client_on_localhost() -> Result<Client, Box<dyn std::error::Error
let static_provider = StaticProvider::new("minioadmin", "minioadmin", None);
let client = ClientBuilder::new(base_url.clone())
.provider(Some(Box::new(static_provider)))
.provider(Some(static_provider))
.build()?;
Ok(client)
}

View File

@@ -35,7 +35,7 @@ async fn main() -> Result<(), Box<dyn std::error::Error + Send + Sync>> {
let static_provider = StaticProvider::new("admin", "admin", None);
let client = ClientBuilder::new(base_url.clone())
.provider(Some(Box::new(static_provider)))
.provider(Some(static_provider))
.ignore_cert_check(Some(true))
.build()?;

View File

@@ -42,7 +42,7 @@ async fn main() -> Result<(), Box<dyn std::error::Error + Send + Sync>> {
);
let client: Client = ClientBuilder::new("https://play.min.io".parse()?)
.provider(Some(Box::new(static_provider)))
.provider(Some(static_provider))
.build()?;
let resp: BucketExistsResponse = client.bucket_exists(&args.bucket).send().await.unwrap();