chore(clippy): enable if_then_some_else_none lint (#11679)

Signed-off-by: jsvisa <delweng@gmail.com>
Co-authored-by: Matthias Seitz <matthias.seitz@outlook.de>
This commit is contained in:
Delweng
2024-10-14 23:45:26 +08:00
committed by GitHub
parent 523bfb9c81
commit f684dd4c4c
22 changed files with 87 additions and 135 deletions

View File

@ -134,17 +134,10 @@ impl ConfigureEvmEnv for EthEvmConfig {
let spec_id = revm_spec_by_timestamp_after_merge(&self.chain_spec, attributes.timestamp);
// if the parent block did not have excess blob gas (i.e. it was pre-cancun), but it is
// cancun now, we need to set the excess blob gas to the default value
// cancun now, we need to set the excess blob gas to the default value(0)
let blob_excess_gas_and_price = parent
.next_block_excess_blob_gas()
.or_else(|| {
if spec_id == SpecId::CANCUN {
// default excess blob gas is zero
Some(0)
} else {
None
}
})
.or_else(|| (spec_id == SpecId::CANCUN).then_some(0))
.map(BlobExcessGasAndPrice::new);
let mut basefee = parent.next_block_base_fee(