aboutsummaryrefslogtreecommitdiff
path: root/src/model/helper/bucket.rs
diff options
context:
space:
mode:
authorAlex Auvolat <alex@adnab.me>2022-03-14 12:00:23 +0100
committerAlex Auvolat <alex@adnab.me>2022-03-14 12:27:49 +0100
commitba6b56ae68d5842d814769418d484093865261aa (patch)
tree2620aadaa46718680ba6e66946ca487839335f56 /src/model/helper/bucket.rs
parent0af314b295f70fdf107524b08063f4d36fb4eeb6 (diff)
downloadgarage-fix-resync.tar.gz
garage-fix-resync.zip
Fix some new clippy lintsfix-resync
Diffstat (limited to 'src/model/helper/bucket.rs')
-rw-r--r--src/model/helper/bucket.rs6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/model/helper/bucket.rs b/src/model/helper/bucket.rs
index 92b9f4cd..706faf26 100644
--- a/src/model/helper/bucket.rs
+++ b/src/model/helper/bucket.rs
@@ -30,8 +30,7 @@ impl<'a> BucketHelper<'a> {
// the AWS spec, and hex-encoded UUIDs are 64 chars long.
let hexbucket = hex::decode(bucket_name.as_str())
.ok()
- .map(|by| Uuid::try_from(&by))
- .flatten();
+ .and_then(|by| Uuid::try_from(&by));
if let Some(bucket_id) = hexbucket {
Ok(self
.0
@@ -46,8 +45,7 @@ impl<'a> BucketHelper<'a> {
.bucket_alias_table
.get(&EmptyKey, bucket_name)
.await?
- .map(|x| *x.state.get())
- .flatten())
+ .and_then(|x| *x.state.get()))
}
}