Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(clippy): make clippy happy #933

Merged
merged 1 commit into from
Jan 19, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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