Skip to content

Commit

Permalink
chore(clippy): make clippy happy (#933)
Browse files Browse the repository at this point in the history
  • Loading branch information
mattsse authored Jan 19, 2023
1 parent 54e9b12 commit 013eb51
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 9 deletions.
8 changes: 3 additions & 5 deletions crates/stages/src/stages/hashing_account.rs
Original file line number Diff line number Diff line change
Expand Up @@ -235,8 +235,7 @@ mod tests {
&self,
blocks: Vec<SealedBlock>,
) -> Result<(), TestRunnerError> {
let mut blocks_iter = blocks.iter();
while let Some(block) = blocks_iter.next() {
for block in blocks.iter() {
self.tx.commit(|tx| {
insert_canonical_block(tx, block, true).unwrap();
Ok(())
Expand All @@ -248,10 +247,9 @@ mod tests {

pub(crate) fn insert_accounts(
&self,
accounts: &Vec<(Address, Account)>,
accounts: &[(Address, Account)],
) -> Result<(), TestRunnerError> {
let mut accs_iter = accounts.iter();
while let Some((addr, acc)) = accs_iter.next() {
for (addr, acc) in accounts.iter() {
self.tx.commit(|tx| {
tx.put::<tables::PlainAccountState>(*addr, *acc)?;
Ok(())
Expand Down
8 changes: 4 additions & 4 deletions crates/stages/src/stages/hashing_storage.rs
Original file line number Diff line number Diff line change
Expand Up @@ -294,10 +294,10 @@ mod tests {

self.tx.insert_headers(blocks.iter().map(|block| &block.header))?;

let mut iter = blocks.iter();
let iter = blocks.iter();
let (mut transition_id, mut tx_id) = (0, 0);

while let Some(progress) = iter.next() {
for progress in iter {
// Insert last progress data
self.tx.commit(|tx| {
let key: BlockNumHash = (progress.number, progress.hash()).into();
Expand Down Expand Up @@ -423,9 +423,9 @@ mod tests {
let mut storage_cursor = tx.cursor_dup_write::<tables::PlainStorageState>()?;
let prev_entry = storage_cursor
.seek_by_key_subkey(tid_address.address(), entry.key)?
.and_then(|e| {
.map(|e| {
storage_cursor.delete_current().expect("failed to delete entry");
Some(e)
e
})
.unwrap_or(StorageEntry { key: entry.key, value: U256::from(0) });
if hash {
Expand Down

0 comments on commit 013eb51

Please sign in to comment.