Appease clippy

This commit is contained in:
Paul Hauner
2022-11-14 17:44:39 +11:00
parent fb49408a92
commit c63fece35c
3 changed files with 5 additions and 5 deletions

View File

@@ -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(),
)?;
}

View File

@@ -427,7 +427,7 @@ pub fn serve<T: 'static + SlotClock + Clone, E: EthSpec>(
))
})?;
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() {

View File

@@ -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<P: AsRef<Path>>(
) -> Result<(ValidatorClientHttpClient, Vec<SingleKeystoreResponse>), 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| {