mirror of
https://github.com/sigp/lighthouse.git
synced 2026-03-11 18:04:18 +00:00
Clippy clean (#536)
* Change into_iter to iter * Fix clippy 'easy' warnings * Clippy eth2/utils * Add struct NetworkInfo * Clippy for types, utils, and beacon_node/store/src/iters.rs * Cargo fmt * Change foo to my_foo * Remove complex signature * suppress clippy warning for unit_value in benches * Use enumerate instead of iterating over range * Allow trivially_copy_pass_by_ref in serde_utils
This commit is contained in:
@@ -171,17 +171,17 @@ impl Config {
|
||||
.map_err(|e| format!("Unable to deserialize private key: {:?}", e))?;
|
||||
|
||||
let ki = key.identifier();
|
||||
if &ki
|
||||
!= &path
|
||||
if ki
|
||||
!= path
|
||||
.file_name()
|
||||
.ok_or_else(|| "Invalid path".to_string())?
|
||||
.to_string_lossy()
|
||||
{
|
||||
return Err(format!(
|
||||
Err(format!(
|
||||
"The validator key ({:?}) did not match the directory filename {:?}.",
|
||||
ki,
|
||||
path.to_str()
|
||||
));
|
||||
))
|
||||
} else {
|
||||
Ok(key)
|
||||
}
|
||||
@@ -219,10 +219,7 @@ impl Config {
|
||||
&self,
|
||||
range: std::ops::Range<usize>,
|
||||
) -> Result<Vec<Keypair>, String> {
|
||||
Ok(range
|
||||
.into_iter()
|
||||
.map(generate_deterministic_keypair)
|
||||
.collect())
|
||||
Ok(range.map(generate_deterministic_keypair).collect())
|
||||
}
|
||||
|
||||
/// Loads the keypairs according to `self.key_source`. Will return one or more keypairs, or an
|
||||
|
||||
@@ -118,14 +118,14 @@ impl EpochDutiesMap {
|
||||
if let Some(epoch_duty) = epoch_duties.get(signer) {
|
||||
if let Some(duty) = epoch_duty {
|
||||
// Retrieves the duty for a validator at a given slot
|
||||
return Ok(duty.is_work_slot(slot));
|
||||
Ok(duty.is_work_slot(slot))
|
||||
} else {
|
||||
// the validator isn't active
|
||||
return Ok(None);
|
||||
Ok(None)
|
||||
}
|
||||
} else {
|
||||
// validator isn't known
|
||||
return Err(EpochDutiesMapError::UnknownValidator);
|
||||
Err(EpochDutiesMapError::UnknownValidator)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user