mirror of
https://github.com/sigp/lighthouse.git
synced 2026-03-03 00:31:50 +00:00
Rust 1.84 lints (#6781)
* Fix few lints * Fix remaining lints * Use fully qualified syntax
This commit is contained in:
@@ -158,9 +158,7 @@ pub mod deposit_log {
|
||||
};
|
||||
|
||||
let signature_is_valid = deposit_pubkey_signature_message(&deposit_data, spec)
|
||||
.map_or(false, |(public_key, signature, msg)| {
|
||||
signature.verify(&public_key, msg)
|
||||
});
|
||||
.is_some_and(|(public_key, signature, msg)| signature.verify(&public_key, msg));
|
||||
|
||||
Ok(DepositLog {
|
||||
deposit_data,
|
||||
@@ -592,7 +590,7 @@ impl<T: Clone> CachedResponse<T> {
|
||||
|
||||
/// returns `true` if the entry's age is >= age_limit
|
||||
pub fn older_than(&self, age_limit: Option<Duration>) -> bool {
|
||||
age_limit.map_or(false, |limit| self.age() >= limit)
|
||||
age_limit.is_some_and(|limit| self.age() >= limit)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -720,9 +718,9 @@ impl HttpJsonRpc {
|
||||
.await
|
||||
}
|
||||
|
||||
pub async fn get_block_by_number<'a>(
|
||||
pub async fn get_block_by_number(
|
||||
&self,
|
||||
query: BlockByNumberQuery<'a>,
|
||||
query: BlockByNumberQuery<'_>,
|
||||
) -> Result<Option<ExecutionBlock>, Error> {
|
||||
let params = json!([query, RETURN_FULL_TRANSACTION_OBJECTS]);
|
||||
|
||||
|
||||
@@ -2095,7 +2095,7 @@ fn verify_builder_bid<E: EthSpec>(
|
||||
payload: header.timestamp(),
|
||||
expected: payload_attributes.timestamp(),
|
||||
}))
|
||||
} else if block_number.map_or(false, |n| n != header.block_number()) {
|
||||
} else if block_number.is_some_and(|n| n != header.block_number()) {
|
||||
Err(Box::new(InvalidBuilderPayload::BlockNumber {
|
||||
payload: header.block_number(),
|
||||
expected: block_number,
|
||||
|
||||
@@ -41,7 +41,7 @@ pub fn process_payload_status(
|
||||
PayloadStatusV1Status::Valid => {
|
||||
if response
|
||||
.latest_valid_hash
|
||||
.map_or(false, |h| h == head_block_hash)
|
||||
.is_some_and(|h| h == head_block_hash)
|
||||
{
|
||||
// The response is only valid if `latest_valid_hash` is not `null` and
|
||||
// equal to the provided `block_hash`.
|
||||
|
||||
@@ -318,7 +318,7 @@ impl<E: EthSpec> MockExecutionLayer<E> {
|
||||
(self, block_hash)
|
||||
}
|
||||
|
||||
pub async fn with_terminal_block<'a, U, V>(self, func: U) -> Self
|
||||
pub async fn with_terminal_block<U, V>(self, func: U) -> Self
|
||||
where
|
||||
U: Fn(ChainSpec, ExecutionLayer<E>, Option<ExecutionBlock>) -> V,
|
||||
V: Future<Output = ()>,
|
||||
|
||||
Reference in New Issue
Block a user