From ce7f29d0d964132b1c95eac5b822d14b0aad8e83 Mon Sep 17 00:00:00 2001 From: Paul Hauner Date: Wed, 17 Aug 2022 12:18:50 +1000 Subject: [PATCH] Appease clippy --- validator_manager/src/validators/create_validators.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/validator_manager/src/validators/create_validators.rs b/validator_manager/src/validators/create_validators.rs index 54320961fd..166c815ecd 100644 --- a/validator_manager/src/validators/create_validators.rs +++ b/validator_manager/src/validators/create_validators.rs @@ -301,14 +301,14 @@ async fn build_validator_spec_from_cli<'a>( */ let mut validators = Vec::with_capacity(count as usize); - let mut deposits = disable_deposits.then(|| vec![]); + let mut deposits = disable_deposits.then(Vec::new); for (i, derivation_index) in (first_index..first_index + count).enumerate() { // If the voting keystore password was not provided by the user then use a unique random // string for each validator. let voting_keystore_password = voting_keystore_password .clone() - .unwrap_or_else(|| random_password_string()); + .unwrap_or_else(random_password_string); // Set the wallet to the appropriate derivation index. wallet @@ -372,7 +372,7 @@ async fn build_validator_spec_from_cli<'a>( let withdrawal_credentials = if let Some(eth1_withdrawal_address) = eth1_withdrawal_address { - WithdrawalCredentials::eth1(eth1_withdrawal_address, &spec) + WithdrawalCredentials::eth1(eth1_withdrawal_address, spec) } else { // Decrypt the withdrawal keystore so withdrawal credentials can be created. It's // not strictly necessary to decrypt the keystore since we can read the pubkey @@ -382,7 +382,7 @@ async fn build_validator_spec_from_cli<'a>( .withdrawal .decrypt_keypair(withdrawal_keystore_password.as_ref()) .map_err(|e| format!("Failed to decrypt withdrawal keystore {}: {:?}", i, e))?; - WithdrawalCredentials::bls(&withdrawal_keypair.pk, &spec) + WithdrawalCredentials::bls(&withdrawal_keypair.pk, spec) }; // Create a JSON structure equivalent to the one generated by @@ -391,7 +391,7 @@ async fn build_validator_spec_from_cli<'a>( &voting_keypair, withdrawal_credentials.into(), deposit_gwei, - &spec, + spec, )?; deposits.push(json_deposit);