chore(clippy): make clippy happy (#933)

This commit is contained in:
Matthias Seitz
2023-01-19 14:20:35 +01:00
committed by GitHub
parent 54e9b12e65
commit 013eb5151d
2 changed files with 7 additions and 9 deletions

View File

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

View File

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