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

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

View File

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

View File

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