aboutsummaryrefslogtreecommitdiff
path: root/src/api/helpers.rs
diff options
context:
space:
mode:
authorAlex Auvolat <alex@adnab.me>2023-06-14 16:56:15 +0200
committerAlex Auvolat <alex@adnab.me>2023-06-14 16:56:15 +0200
commit7895f99d3afc6e97f62f52abe06a6ee8d0f0617f (patch)
tree54918eaff3880d013d59b77db2091c56c5f45fb7 /src/api/helpers.rs
parent4a82f6380e6a7d7c841477fc914fd96e6c09adad (diff)
downloadgarage-7895f99d3afc6e97f62f52abe06a6ee8d0f0617f.tar.gz
garage-7895f99d3afc6e97f62f52abe06a6ee8d0f0617f.zip
admin and cli: hide secret keys unless asked
Diffstat (limited to 'src/api/helpers.rs')
-rw-r--r--src/api/helpers.rs4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/api/helpers.rs b/src/api/helpers.rs
index 642dbc42..1d55ebd5 100644
--- a/src/api/helpers.rs
+++ b/src/api/helpers.rs
@@ -152,6 +152,10 @@ pub fn json_ok_response<T: Serialize>(res: &T) -> Result<Response<Body>, Error>
.body(Body::from(resp_json))?)
}
+pub fn is_default<T: Default + PartialEq>(v: &T) -> bool {
+ *v == T::default()
+}
+
#[cfg(test)]
mod tests {
use super::*;