From 1dff62564fdda392a97986dca55232f30a1f4234 Mon Sep 17 00:00:00 2001 From: Alex Auvolat Date: Thu, 26 Jan 2023 17:05:31 +0100 Subject: fix clippy --- src/garage/admin.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/garage') diff --git a/src/garage/admin.rs b/src/garage/admin.rs index 4eabebca..2ef3077c 100644 --- a/src/garage/admin.rs +++ b/src/garage/admin.rs @@ -911,7 +911,9 @@ impl AdminRpcHandler { let role = layout.roles.get(id).and_then(|x| x.0.as_ref()); let hostname = status.map(|x| x.hostname.as_str()).unwrap_or("?"); let zone = role.map(|x| x.zone.as_str()).unwrap_or("?"); - let capacity = role.map(|x| x.capacity_string()).unwrap_or("?".into()); + let capacity = role + .map(|x| x.capacity_string()) + .unwrap_or_else(|| "?".into()); let avail_str = |x| match x { Some((avail, total)) => { let pct = (avail as f64) / (total as f64) * 100.; -- cgit v1.2.3