mirror of
https://github.com/sigp/lighthouse.git
synced 2026-03-10 12:11:59 +00:00
Fix clippy lints for rust 1.62 (#3300)
## Issue Addressed Fixes some new clippy lints after the last rust release ### Lints fixed for the curious: - [cast_abs_to_unsigned](https://rust-lang.github.io/rust-clippy/master/index.html#cast_abs_to_unsigned) - [map_identity](https://rust-lang.github.io/rust-clippy/master/index.html#map_identity) - [let_unit_value](https://rust-lang.github.io/rust-clippy/master/index.html#let_unit_value) - [crate_in_macro_def](https://rust-lang.github.io/rust-clippy/master/index.html#crate_in_macro_def) - [extra_unused_lifetimes](https://rust-lang.github.io/rust-clippy/master/index.html#extra_unused_lifetimes) - [format_push_string](https://rust-lang.github.io/rust-clippy/master/index.html#format_push_string)
This commit is contained in:
@@ -1079,12 +1079,10 @@ impl<T: BeaconChainTypes> BeaconChain<T> {
|
||||
}
|
||||
|
||||
/// Apply a function to the canonical head without cloning it.
|
||||
pub fn with_head<U, E>(
|
||||
&self,
|
||||
f: impl FnOnce(&BeaconSnapshot<T::EthSpec>) -> Result<U, E>,
|
||||
) -> Result<U, E>
|
||||
pub fn with_head<U, E, F>(&self, f: F) -> Result<U, E>
|
||||
where
|
||||
E: From<Error>,
|
||||
F: FnOnce(&BeaconSnapshot<T::EthSpec>) -> Result<U, E>,
|
||||
{
|
||||
let head_lock = self
|
||||
.canonical_head
|
||||
|
||||
@@ -1717,14 +1717,13 @@ fn verify_header_signature<T: BeaconChainTypes>(
|
||||
.get(header.message.proposer_index as usize)
|
||||
.cloned()
|
||||
.ok_or(BlockError::UnknownValidator(header.message.proposer_index))?;
|
||||
let (fork, genesis_validators_root) = chain
|
||||
.with_head(|head| {
|
||||
let (fork, genesis_validators_root) =
|
||||
chain.with_head::<_, BlockError<T::EthSpec>, _>(|head| {
|
||||
Ok((
|
||||
head.beacon_state.fork(),
|
||||
head.beacon_state.genesis_validators_root(),
|
||||
))
|
||||
})
|
||||
.map_err(|e: BlockError<T::EthSpec>| e)?;
|
||||
})?;
|
||||
|
||||
if header.verify_signature::<T::EthSpec>(
|
||||
&proposer_pubkey,
|
||||
|
||||
Reference in New Issue
Block a user