diff options
Diffstat (limited to 'src/model/helper/bucket.rs')
-rw-r--r-- | src/model/helper/bucket.rs | 6 |
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())) } } |