diff options
author | Alex Auvolat <lx@deuxfleurs.fr> | 2025-01-31 15:53:02 +0100 |
---|---|---|
committer | Alex Auvolat <lx@deuxfleurs.fr> | 2025-02-03 18:54:51 +0100 |
commit | 7b9c047b113d78dacbece4670b8a1a1cbd771849 (patch) | |
tree | 92e4241de8f981d7011eef3b3871e09175b28656 /src/api | |
parent | 10bbb26b303e7bd58ca3396009a66b70a1673c0f (diff) | |
download | garage-7b9c047b113d78dacbece4670b8a1a1cbd771849.tar.gz garage-7b9c047b113d78dacbece4670b8a1a1cbd771849.zip |
cli_v2: add local_api_request with crazy type bound
Diffstat (limited to 'src/api')
-rw-r--r-- | src/api/admin/api.rs | 16 |
1 files changed, 0 insertions, 16 deletions
diff --git a/src/api/admin/api.rs b/src/api/admin/api.rs index 1034f59c..cf136d28 100644 --- a/src/api/admin/api.rs +++ b/src/api/admin/api.rs @@ -10,7 +10,6 @@ use serde::{Deserialize, Serialize}; use garage_rpc::*; use garage_model::garage::Garage; -use garage_util::error::Error as GarageError; use garage_api_common::common_error::CommonErrorDerivative; use garage_api_common::helpers::is_default; @@ -105,21 +104,6 @@ pub struct MultiResponse<RB> { pub error: HashMap<String, String>, } -impl<RB> MultiResponse<RB> { - pub fn into_single_response(self) -> Result<RB, GarageError> { - if let Some((_, e)) = self.error.into_iter().next() { - return Err(GarageError::Message(e)); - } - if self.success.len() != 1 { - return Err(GarageError::Message(format!( - "{} responses returned, expected 1", - self.success.len() - ))); - } - Ok(self.success.into_iter().next().unwrap().1) - } -} - // ********************************************** // Special endpoints // |