diff options
author | Alex Auvolat <alex@adnab.me> | 2022-11-08 16:15:45 +0100 |
---|---|---|
committer | Alex Auvolat <alex@adnab.me> | 2022-11-08 16:15:45 +0100 |
commit | ec12d6c8ddde0f1dc908e43fef0ecc88d1e5406b (patch) | |
tree | d5e92268aa84c1546514597a98c1cafda0febd68 /src/garage/cli/layout.rs | |
parent | 217abdca18ff15190c0407b2b8b1ea204edcfb99 (diff) | |
download | garage-ec12d6c8ddde0f1dc908e43fef0ecc88d1e5406b.tar.gz garage-ec12d6c8ddde0f1dc908e43fef0ecc88d1e5406b.zip |
Slightly simplify code at places
Diffstat (limited to 'src/garage/cli/layout.rs')
-rw-r--r-- | src/garage/cli/layout.rs | 11 |
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 ===="); |