From af4e386b8bbff0e7a7a424896bf4cb591f2eab28 Mon Sep 17 00:00:00 2001 From: Al3xGROS Date: Fri, 19 Apr 2024 16:34:25 +0200 Subject: [PATCH] fix: cargo clippy warning fix --- crates/ash_cli/src/avalanche/validator.rs | 18 ++++-------------- 1 file changed, 4 insertions(+), 14 deletions(-) diff --git a/crates/ash_cli/src/avalanche/validator.rs b/crates/ash_cli/src/avalanche/validator.rs index ccb736b..fa751f0 100644 --- a/crates/ash_cli/src/avalanche/validator.rs +++ b/crates/ash_cli/src/avalanche/validator.rs @@ -107,14 +107,12 @@ fn list( ) -> Result<(), CliError> { let mut network = load_network(network_name, config)?; update_network_subnets(&mut network)?; - let subnet; - let validators; update_subnet_validators(&mut network, subnet_id)?; - subnet = network + let subnet = network .get_subnet(parse_id(subnet_id)?) .map_err(|e| CliError::dataerr(format!("Error listing validators: {e}")))?; - validators = subnet.validators.clone(); + let validators = subnet.validators.clone(); format!( "Found {} validators on Subnet '{}':", type_colorize(&subnet.validators.len()), @@ -234,10 +232,7 @@ fn add( start_time_parsed, end_time_parsed, delegation_fee, - match signer { - Some(_) => Some(signer_parsed), - None => None, - }, + signer.map(|_| signer_parsed), wait, ) .await @@ -309,11 +304,6 @@ pub(crate) fn parse( ValidatorSubcommands::Info { id } => { info(&validator.network, &validator.subnet_id, &id, config, json) } - ValidatorSubcommands::List => list( - &validator.network, - &validator.subnet_id, - config, - json, - ), + ValidatorSubcommands::List => list(&validator.network, &validator.subnet_id, config, json), } }