diff --git a/common/validator_dir/src/builder.rs b/common/validator_dir/src/builder.rs index 4ab9764f84..22888e9d4d 100644 --- a/common/validator_dir/src/builder.rs +++ b/common/validator_dir/src/builder.rs @@ -247,7 +247,7 @@ impl<'a> Builder<'a> { if self.store_withdrawal_keystore { // Write the withdrawal password to file. write_password_to_file( - keystore_password_path(&password_dir, &withdrawal_keystore), + keystore_password_path(password_dir, &withdrawal_keystore), withdrawal_password.as_bytes(), )?; @@ -263,7 +263,7 @@ impl<'a> Builder<'a> { if let Some(password_dir) = self.password_dir.as_ref() { // Write the voting password to file. write_password_to_file( - keystore_password_path(&password_dir, &voting_keystore), + keystore_password_path(password_dir, &voting_keystore), voting_password.as_bytes(), )?; } diff --git a/validator_client/src/http_api/mod.rs b/validator_client/src/http_api/mod.rs index 657f3bc008..aba1b658a0 100644 --- a/validator_client/src/http_api/mod.rs +++ b/validator_client/src/http_api/mod.rs @@ -427,7 +427,7 @@ pub fn serve( )) })?; - let secrets_dir = store_passwords_in_secrets_dir.then(|| secrets_dir); + let secrets_dir = store_passwords_in_secrets_dir.then_some(secrets_dir); let password_storage = if let Some(secrets_dir) = &secrets_dir { let password_path = keystore_password_path(secrets_dir, &body.keystore); if password_path.exists() { diff --git a/validator_manager/src/validators/common.rs b/validator_manager/src/validators/common.rs index 3f375a10f1..6addb46a3b 100644 --- a/validator_manager/src/validators/common.rs +++ b/validator_manager/src/validators/common.rs @@ -284,7 +284,7 @@ mod bytes_4_without_0x_prefix { where S: serde::Serializer, { - let hex_string = &hex::encode(&bytes); + let hex_string = &hex::encode(bytes); serializer.serialize_str(hex_string) } @@ -314,7 +314,7 @@ pub async fn vc_http_client>( ) -> Result<(ValidatorClientHttpClient, Vec), String> { let token_path = token_path.as_ref(); let token_bytes = - fs::read(&token_path).map_err(|e| format!("Failed to read {:?}: {:?}", token_path, e))?; + fs::read(token_path).map_err(|e| format!("Failed to read {:?}: {:?}", token_path, e))?; let token_string = String::from_utf8(strip_off_newlines(token_bytes)) .map_err(|e| format!("Failed to parse {:?} as utf8: {:?}", token_path, e))?; let http_client = ValidatorClientHttpClient::new(url.clone(), token_string).map_err(|e| {