From ba6b56ae68d5842d814769418d484093865261aa Mon Sep 17 00:00:00 2001 From: Alex Auvolat Date: Mon, 14 Mar 2022 12:00:23 +0100 Subject: Fix some new clippy lints --- src/model/helper/bucket.rs | 6 ++---- src/model/key_table.rs | 3 +-- 2 files changed, 3 insertions(+), 6 deletions(-) (limited to 'src/model') 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())) } } diff --git a/src/model/key_table.rs b/src/model/key_table.rs index d5e30f3f..330e83f0 100644 --- a/src/model/key_table.rs +++ b/src/model/key_table.rs @@ -106,8 +106,7 @@ impl Key { /// Get permissions for a bucket pub fn bucket_permissions(&self, bucket: &Uuid) -> BucketKeyPerm { self.params() - .map(|params| params.authorized_buckets.get(bucket)) - .flatten() + .and_then(|params| params.authorized_buckets.get(bucket)) .cloned() .unwrap_or(BucketKeyPerm::NO_PERMISSIONS) } -- cgit v1.2.3