mirror of
https://github.com/sigp/lighthouse.git
synced 2026-04-19 13:58:28 +00:00
Rust 1.85 lints (#7019)
N/A 2 changes: 1. Replace Option::map_or(true, ...) with is_none_or(...) 2. Remove unnecessary `Into::into` blocks where the type conversion is apparent from the types
This commit is contained in:
@@ -1450,19 +1450,17 @@ where
|
||||
return Err(Error::UnknownTargetRoot(target.root));
|
||||
}
|
||||
|
||||
chain
|
||||
.with_committee_cache(target.root, attestation_epoch, |committee_cache, _| {
|
||||
let committees_per_slot = committee_cache.committees_per_slot();
|
||||
chain.with_committee_cache(target.root, attestation_epoch, |committee_cache, _| {
|
||||
let committees_per_slot = committee_cache.committees_per_slot();
|
||||
|
||||
Ok(committee_cache
|
||||
.get_beacon_committees_at_slot(attestation.data().slot)
|
||||
.map(|committees| map_fn((committees, committees_per_slot)))
|
||||
.unwrap_or_else(|_| {
|
||||
Err(Error::NoCommitteeForSlotAndIndex {
|
||||
slot: attestation.data().slot,
|
||||
index: attestation.committee_index().unwrap_or(0),
|
||||
})
|
||||
}))
|
||||
})
|
||||
.map_err(BeaconChainError::from)?
|
||||
Ok(committee_cache
|
||||
.get_beacon_committees_at_slot(attestation.data().slot)
|
||||
.map(|committees| map_fn((committees, committees_per_slot)))
|
||||
.unwrap_or_else(|_| {
|
||||
Err(Error::NoCommitteeForSlotAndIndex {
|
||||
slot: attestation.data().slot,
|
||||
index: attestation.committee_index().unwrap_or(0),
|
||||
})
|
||||
}))
|
||||
})?
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user