Skip to content

Commit

Permalink
Make get_bucket_region style consistent with others
Browse files Browse the repository at this point in the history
  • Loading branch information
lusingander committed Oct 4, 2024
1 parent 7bbaf82 commit e8de9e3
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions src/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -116,18 +116,17 @@ impl Client {
return Ok(bucket_region);
}

let bucket_region = self
let result = self
.client
.get_bucket_location()
.bucket(bucket_name)
.send()
.await
.map_err(|e| {
AppError::new(
format!("Failed to fetch region for bucket {}", bucket_name),
e,
)
})?
.await;
let output = result.map_err(|e| {
AppError::new(format!("Failed to fetch region for '{}'", bucket_name), e)
})?;

let bucket_region = output
.location_constraint()
.map(|loc| {
if loc.as_str().is_empty() {
Expand Down

0 comments on commit e8de9e3

Please sign in to comment.