aboutsummaryrefslogtreecommitdiff
path: root/src/garage
diff options
context:
space:
mode:
authorAlex Auvolat <alex@adnab.me>2022-11-08 16:15:45 +0100
committerAlex Auvolat <alex@adnab.me>2022-11-08 16:15:45 +0100
commitec12d6c8ddde0f1dc908e43fef0ecc88d1e5406b (patch)
treed5e92268aa84c1546514597a98c1cafda0febd68 /src/garage
parent217abdca18ff15190c0407b2b8b1ea204edcfb99 (diff)
downloadgarage-ec12d6c8ddde0f1dc908e43fef0ecc88d1e5406b.tar.gz
garage-ec12d6c8ddde0f1dc908e43fef0ecc88d1e5406b.zip
Slightly simplify code at places
Diffstat (limited to 'src/garage')
-rw-r--r--src/garage/cli/layout.rs11
1 files changed, 4 insertions, 7 deletions
diff --git a/src/garage/cli/layout.rs b/src/garage/cli/layout.rs
index 53430e6b..27bb7eb8 100644
--- a/src/garage/cli/layout.rs
+++ b/src/garage/cli/layout.rs
@@ -209,16 +209,13 @@ pub async fn cmd_show_layout(
"You can also revert all proposed changes with: garage layout revert --version {}",
v + 1)
}
- Err(Error::Message(s)) => {
- println!("Error while trying to compute the assignation: {}", s);
+ Err(e) => {
+ println!("Error while trying to compute the assignation: {}", e);
println!("This new layout cannot yet be applied.");
println!(
"You can also revert all proposed changes with: garage layout revert --version {}",
v + 1)
}
- _ => {
- println!("Unknown Error");
- }
}
}
@@ -355,7 +352,7 @@ pub fn print_cluster_layout(layout: &ClusterLayout) -> bool {
id,
tags,
role.zone,
- role.capacity_string(),
+ role.capacity_string()
));
};
}
@@ -372,7 +369,7 @@ pub fn print_cluster_layout(layout: &ClusterLayout) -> bool {
}
pub fn print_staging_parameters_changes(layout: &ClusterLayout) -> bool {
- let has_changes = layout.staging_parameters.get().clone() != layout.parameters;
+ let has_changes = *layout.staging_parameters.get() != layout.parameters;
if has_changes {
println!();
println!("==== NEW LAYOUT PARAMETERS ====");