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:
Pawan Dhananjay
2025-02-23 18:36:13 -08:00
committed by GitHub
parent ff739d56be
commit b3b6aea1c5
33 changed files with 102 additions and 128 deletions

View File

@@ -112,7 +112,7 @@ impl<E: EthSpec> BlsToExecutionChanges<E> {
head_state
.validators()
.get(validator_index as usize)
.map_or(true, |validator| {
.is_none_or(|validator| {
let prune = validator.has_execution_withdrawal_credential(spec)
&& head_block
.message()

View File

@@ -767,7 +767,7 @@ fn prune_validator_hash_map<T, F, E: EthSpec>(
&& head_state
.validators()
.get(validator_index as usize)
.map_or(true, |validator| !prune_if(validator_index, validator))
.is_none_or(|validator| !prune_if(validator_index, validator))
});
}

View File

@@ -83,7 +83,7 @@ impl RewardCache {
if self
.initialization
.as_ref()
.map_or(true, |init| *init != new_init)
.is_none_or(|init| *init != new_init)
{
self.update_previous_epoch_participation(state)
.map_err(OpPoolError::RewardCacheUpdatePrevEpoch)?;