diff --git a/src/tracing/builder/parity.rs b/src/tracing/builder/parity.rs index 16e1c46..8ee8238 100644 --- a/src/tracing/builder/parity.rs +++ b/src/tracing/builder/parity.rs @@ -411,9 +411,11 @@ where fn next(&mut self) -> Option { // ensure the selfdestruct trace is emitted just at the ending of the same depth if let Some(selfdestruct) = &self.next_selfdestruct { - if self.iter.peek().map_or(true, |(next_trace, _)| { - selfdestruct.trace_address < next_trace.trace_address - }) { + if self + .iter + .peek() + .is_none_or(|(next_trace, _)| selfdestruct.trace_address < next_trace.trace_address) + { return self.next_selfdestruct.take(); } } diff --git a/src/tracing/config.rs b/src/tracing/config.rs index edf5445..c4c0f55 100644 --- a/src/tracing/config.rs +++ b/src/tracing/config.rs @@ -340,7 +340,7 @@ impl TracingInspectorConfig { /// Otherwise, always returns true. #[inline] pub fn should_record_opcode(&self, op: OpCode) -> bool { - self.record_opcodes_filter.as_ref().map_or(true, |filter| filter.is_enabled(op)) + self.record_opcodes_filter.as_ref().is_none_or(|filter| filter.is_enabled(op)) } } diff --git a/src/tracing/utils.rs b/src/tracing/utils.rs index 2b52c45..d859a2a 100644 --- a/src/tracing/utils.rs +++ b/src/tracing/utils.rs @@ -40,18 +40,13 @@ pub(crate) fn load_account_code( db: DB, db_acc: &revm::primitives::AccountInfo, ) -> Option { - db_acc - .code - .as_ref() - .map(|code| code.original_bytes()) - .or_else(|| { - if db_acc.code_hash == KECCAK_EMPTY { - None - } else { - db.code_by_hash_ref(db_acc.code_hash).ok().map(|code| code.original_bytes()) - } - }) - .map(Into::into) + db_acc.code.as_ref().map(|code| code.original_bytes()).or_else(|| { + if db_acc.code_hash == KECCAK_EMPTY { + None + } else { + db.code_by_hash_ref(db_acc.code_hash).ok().map(|code| code.original_bytes()) + } + }) } /// Returns a non empty revert reason if the output is a revert/error.