mirror of
https://github.com/hl-archive-node/nanoreth.git
synced 2025-12-06 10:59:55 +00:00
add explicit_iter_loop clippy lint (#8570)
Co-authored-by: Matthias Seitz <matthias.seitz@outlook.de>
This commit is contained in:
@ -148,7 +148,7 @@ impl Case for BlockchainTestCase {
|
||||
match (&case.post_state, &case.post_state_hash) {
|
||||
(Some(state), None) => {
|
||||
// Validate accounts in the state against the provider's database.
|
||||
for (&address, account) in state.iter() {
|
||||
for (&address, account) in state {
|
||||
account.assert_db(address, provider.tx_ref())?;
|
||||
}
|
||||
}
|
||||
|
||||
@ -154,7 +154,7 @@ pub struct State(BTreeMap<Address, Account>);
|
||||
impl State {
|
||||
/// Write the state to the database.
|
||||
pub fn write_to_db(&self, tx: &impl DbTxMut) -> Result<(), Error> {
|
||||
for (&address, account) in self.0.iter() {
|
||||
for (&address, account) in &self.0 {
|
||||
let hashed_address = keccak256(address);
|
||||
let has_code = !account.code.is_empty();
|
||||
let code_hash = has_code.then(|| keccak256(&account.code));
|
||||
@ -230,7 +230,7 @@ impl Account {
|
||||
}
|
||||
|
||||
let mut storage_cursor = tx.cursor_dup_read::<tables::PlainStorageState>()?;
|
||||
for (slot, value) in self.storage.iter() {
|
||||
for (slot, value) in &self.storage {
|
||||
if let Some(entry) =
|
||||
storage_cursor.seek_by_key_subkey(address, B256::new(slot.to_be_bytes()))?
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user