mirror of
https://github.com/sigp/lighthouse.git
synced 2026-04-18 21:38:31 +00:00
Rust 1.84 lints (#6781)
* Fix few lints * Fix remaining lints * Use fully qualified syntax
This commit is contained in:
@@ -265,7 +265,7 @@ impl<'a, E: EthSpec, Hot: ItemStore<E>, Cold: ItemStore<E>>
|
||||
// `end_slot`. If it tries to continue further a `NoContinuationData` error will be
|
||||
// returned.
|
||||
let continuation_data =
|
||||
if end_slot.map_or(false, |end_slot| end_slot < freezer_upper_bound) {
|
||||
if end_slot.is_some_and(|end_slot| end_slot < freezer_upper_bound) {
|
||||
None
|
||||
} else {
|
||||
Some(Box::new(get_state()?))
|
||||
@@ -306,7 +306,7 @@ impl<'a, E: EthSpec, Hot: ItemStore<E>, Cold: ItemStore<E>>
|
||||
None => {
|
||||
// If the iterator has an end slot (inclusive) which has already been
|
||||
// covered by the (exclusive) frozen forwards iterator, then we're done!
|
||||
if end_slot.map_or(false, |end_slot| iter.end_slot == end_slot + 1) {
|
||||
if end_slot.is_some_and(|end_slot| iter.end_slot == end_slot + 1) {
|
||||
*self = Finished;
|
||||
return Ok(None);
|
||||
}
|
||||
|
||||
@@ -111,7 +111,7 @@ where
|
||||
self.store_cold_state(&state_root, &state, &mut io_batch)?;
|
||||
|
||||
let batch_complete =
|
||||
num_blocks.map_or(false, |n_blocks| slot == lower_limit_slot + n_blocks as u64);
|
||||
num_blocks.is_some_and(|n_blocks| slot == lower_limit_slot + n_blocks as u64);
|
||||
let reconstruction_complete = slot + 1 == upper_limit_slot;
|
||||
|
||||
// Commit the I/O batch if:
|
||||
|
||||
@@ -77,9 +77,7 @@ impl<E: EthSpec> StateCache<E> {
|
||||
if self
|
||||
.finalized_state
|
||||
.as_ref()
|
||||
.map_or(false, |finalized_state| {
|
||||
state.slot() < finalized_state.state.slot()
|
||||
})
|
||||
.is_some_and(|finalized_state| state.slot() < finalized_state.state.slot())
|
||||
{
|
||||
return Err(Error::FinalizedStateDecreasingSlot);
|
||||
}
|
||||
@@ -127,9 +125,7 @@ impl<E: EthSpec> StateCache<E> {
|
||||
if self
|
||||
.finalized_state
|
||||
.as_ref()
|
||||
.map_or(false, |finalized_state| {
|
||||
finalized_state.state_root == state_root
|
||||
})
|
||||
.is_some_and(|finalized_state| finalized_state.state_root == state_root)
|
||||
{
|
||||
return Ok(PutStateOutcome::Finalized);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user