add explicit_iter_loop clippy lint (#8570)

Co-authored-by: Matthias Seitz <matthias.seitz@outlook.de>
This commit is contained in:
Thomas Coratger
2024-06-03 20:14:50 +02:00
committed by GitHub
parent 6e446084f0
commit 2b4fa96065
47 changed files with 79 additions and 78 deletions

View File

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

View File

@ -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()))?
{