aboutsummaryrefslogtreecommitdiff
path: root/src/model
diff options
context:
space:
mode:
authorAlex Auvolat <alex@adnab.me>2022-05-13 19:18:51 +0200
committerAlex Auvolat <alex@adnab.me>2022-05-13 19:18:51 +0200
commitea325d78d36d19f59a0849ace1f4567e2b095bd7 (patch)
treebfc05dd1f8df3d1fae84a1af433f4ae56dbc2c31 /src/model
parentec16d166f940f59098ae5cc0c0b3d8298f1bcc78 (diff)
downloadgarage-ea325d78d36d19f59a0849ace1f4567e2b095bd7.tar.gz
garage-ea325d78d36d19f59a0849ace1f4567e2b095bd7.zip
More error refactoring
Diffstat (limited to 'src/model')
-rw-r--r--src/model/helper/bucket.rs12
1 files changed, 4 insertions, 8 deletions
diff --git a/src/model/helper/bucket.rs b/src/model/helper/bucket.rs
index 2f1c6ae9..734cb40e 100644
--- a/src/model/helper/bucket.rs
+++ b/src/model/helper/bucket.rs
@@ -6,10 +6,10 @@ use garage_util::time::*;
use crate::bucket_alias_table::*;
use crate::bucket_table::*;
-use crate::key_table::*;
use crate::garage::Garage;
use crate::helper::error::*;
use crate::helper::key::KeyHelper;
+use crate::key_table::*;
use crate::permission::BucketKeyPerm;
pub struct BucketHelper<'a>(pub(crate) &'a Garage);
@@ -51,11 +51,7 @@ impl<'a> BucketHelper<'a> {
}
#[allow(clippy::ptr_arg)]
- pub async fn resolve_bucket(
- &self,
- bucket_name: &String,
- api_key: &Key,
- ) -> Result<Uuid, Error> {
+ pub async fn resolve_bucket(&self, bucket_name: &String, api_key: &Key) -> Result<Uuid, Error> {
let api_key_params = api_key
.state
.as_option()
@@ -64,8 +60,8 @@ impl<'a> BucketHelper<'a> {
if let Some(Some(bucket_id)) = api_key_params.local_aliases.get(bucket_name) {
Ok(*bucket_id)
} else {
- Ok(self.
- resolve_global_bucket_name(bucket_name)
+ Ok(self
+ .resolve_global_bucket_name(bucket_name)
.await?
.ok_or_else(|| Error::NoSuchBucket(bucket_name.to_string()))?)
}