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:
@@ -1164,7 +1164,7 @@ pub fn serve<T: BeaconChainTypes>(
|
||||
.map_err(warp_utils::reject::beacon_chain_error)?
|
||||
// Ignore any skip-slots immediately following the parent.
|
||||
.find(|res| {
|
||||
res.as_ref().map_or(false, |(root, _)| *root != parent_root)
|
||||
res.as_ref().is_ok_and(|(root, _)| *root != parent_root)
|
||||
})
|
||||
.transpose()
|
||||
.map_err(warp_utils::reject::beacon_chain_error)?
|
||||
@@ -1249,7 +1249,7 @@ pub fn serve<T: BeaconChainTypes>(
|
||||
let canonical = chain
|
||||
.block_root_at_slot(block.slot(), WhenSlotSkipped::None)
|
||||
.map_err(warp_utils::reject::beacon_chain_error)?
|
||||
.map_or(false, |canonical| root == canonical);
|
||||
.is_some_and(|canonical| root == canonical);
|
||||
|
||||
let data = api_types::BlockHeaderData {
|
||||
root,
|
||||
|
||||
@@ -14,7 +14,7 @@ pub fn pubkey_to_validator_index<T: BeaconChainTypes>(
|
||||
state
|
||||
.validators()
|
||||
.get(index)
|
||||
.map_or(false, |v| v.pubkey == *pubkey)
|
||||
.is_some_and(|v| v.pubkey == *pubkey)
|
||||
})
|
||||
.map(Result::Ok)
|
||||
.transpose()
|
||||
|
||||
@@ -161,7 +161,7 @@ impl ForkChoiceUpdates {
|
||||
update
|
||||
.payload_attributes
|
||||
.as_ref()
|
||||
.map_or(false, |payload_attributes| {
|
||||
.is_some_and(|payload_attributes| {
|
||||
payload_attributes.timestamp() == proposal_timestamp
|
||||
})
|
||||
})
|
||||
|
||||
@@ -1278,7 +1278,7 @@ impl ApiTester {
|
||||
.chain
|
||||
.block_root_at_slot(block.slot(), WhenSlotSkipped::None)
|
||||
.unwrap()
|
||||
.map_or(false, |canonical| block_root == canonical);
|
||||
.is_some_and(|canonical| block_root == canonical);
|
||||
|
||||
assert_eq!(result.canonical, canonical, "{:?}", block_id);
|
||||
assert_eq!(result.root, block_root, "{:?}", block_id);
|
||||
|
||||
Reference in New Issue
Block a user