Rust 1.84 lints (#6781)

* Fix few lints

* Fix remaining lints

* Use fully qualified syntax
This commit is contained in:
Pawan Dhananjay
2025-01-10 06:43:29 +05:30
committed by GitHub
parent 87b72dec21
commit 1f6850fae2
61 changed files with 110 additions and 138 deletions

View File

@@ -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,

View File

@@ -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()

View File

@@ -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
})
})

View File

@@ -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);