chore: fix all the obvious clippy warnings (#1520)

This commit is contained in:
tomarST
2023-02-26 05:10:52 -03:30
committed by GitHub
parent b1741bd86b
commit 662fd87288
4 changed files with 14 additions and 19 deletions

View File

@ -258,8 +258,8 @@ mod tests {
} }
async fn run(tx: &TestTransaction, run_to: u64) { async fn run(tx: &TestTransaction, run_to: u64) {
let mut input = ExecInput::default(); let input =
input.previous_stage = Some((PREV_STAGE_ID, run_to)); ExecInput { previous_stage: Some((PREV_STAGE_ID, run_to)), ..Default::default() };
let mut stage = IndexAccountHistoryStage::default(); let mut stage = IndexAccountHistoryStage::default();
let mut tx = tx.inner(); let mut tx = tx.inner();
let out = stage.execute(&mut tx, input).await.unwrap(); let out = stage.execute(&mut tx, input).await.unwrap();
@ -268,9 +268,7 @@ mod tests {
} }
async fn unwind(tx: &TestTransaction, unwind_from: u64, unwind_to: u64) { async fn unwind(tx: &TestTransaction, unwind_from: u64, unwind_to: u64) {
let mut input = UnwindInput::default(); let input = UnwindInput { stage_progress: unwind_from, unwind_to, ..Default::default() };
input.stage_progress = unwind_from;
input.unwind_to = unwind_to;
let mut stage = IndexAccountHistoryStage::default(); let mut stage = IndexAccountHistoryStage::default();
let mut tx = tx.inner(); let mut tx = tx.inner();
let out = stage.unwind(&mut tx, input).await.unwrap(); let out = stage.unwind(&mut tx, input).await.unwrap();

View File

@ -282,8 +282,8 @@ mod tests {
} }
async fn run(tx: &TestTransaction, run_to: u64) { async fn run(tx: &TestTransaction, run_to: u64) {
let mut input = ExecInput::default(); let input =
input.previous_stage = Some((PREV_STAGE_ID, run_to)); ExecInput { previous_stage: Some((PREV_STAGE_ID, run_to)), ..Default::default() };
let mut stage = IndexStorageHistoryStage::default(); let mut stage = IndexStorageHistoryStage::default();
let mut tx = tx.inner(); let mut tx = tx.inner();
let out = stage.execute(&mut tx, input).await.unwrap(); let out = stage.execute(&mut tx, input).await.unwrap();
@ -292,9 +292,7 @@ mod tests {
} }
async fn unwind(tx: &TestTransaction, unwind_from: u64, unwind_to: u64) { async fn unwind(tx: &TestTransaction, unwind_from: u64, unwind_to: u64) {
let mut input = UnwindInput::default(); let input = UnwindInput { stage_progress: unwind_from, unwind_to, ..Default::default() };
input.stage_progress = unwind_from;
input.unwind_to = unwind_to;
let mut stage = IndexStorageHistoryStage::default(); let mut stage = IndexStorageHistoryStage::default();
let mut tx = tx.inner(); let mut tx = tx.inner();
let out = stage.unwind(&mut tx, input).await.unwrap(); let out = stage.unwind(&mut tx, input).await.unwrap();
@ -357,8 +355,7 @@ mod tests {
async fn insert_index_to_full_shard() { async fn insert_index_to_full_shard() {
// init // init
let tx = TestTransaction::default(); let tx = TestTransaction::default();
let mut input = ExecInput::default(); let _input = ExecInput { previous_stage: Some((PREV_STAGE_ID, 5)), ..Default::default() };
input.previous_stage = Some((PREV_STAGE_ID, 5));
// change does not matter only that account is present in changeset. // change does not matter only that account is present in changeset.
let full_list = vec![3; NUM_OF_INDICES_IN_SHARD]; let full_list = vec![3; NUM_OF_INDICES_IN_SHARD];

View File

@ -147,7 +147,7 @@ where
crsr.append(k, v).expect("submit"); crsr.append(k, v).expect("submit");
} }
tx.inner.commit().unwrap(); tx.inner.commit().unwrap()
}); });
}, },
) )
@ -171,7 +171,7 @@ where
crsr.insert(k, v).expect("submit"); crsr.insert(k, v).expect("submit");
} }
tx.inner.commit().unwrap(); tx.inner.commit().unwrap()
}); });
}, },
) )
@ -241,7 +241,7 @@ where
crsr.append_dup(k, v).expect("submit"); crsr.append_dup(k, v).expect("submit");
} }
tx.inner.commit().unwrap(); tx.inner.commit().unwrap()
}); });
}, },
) )

View File

@ -39,7 +39,7 @@ pub fn hash_keys(c: &mut Criterion) {
group.sample_size(10); group.sample_size(10);
for size in vec![10_000, 100_000, 1_000_000] { for size in [10_000, 100_000, 1_000_000] {
measure_table_insertion::<TxHashNumber>(&mut group, size); measure_table_insertion::<TxHashNumber>(&mut group, size);
} }
} }
@ -176,7 +176,7 @@ where
crsr.append(k, v).expect("submit"); crsr.append(k, v).expect("submit");
} }
tx.inner.commit().unwrap(); tx.inner.commit().unwrap()
}); });
} }
db db
@ -197,7 +197,7 @@ where
crsr.insert(k, v).expect("submit"); crsr.insert(k, v).expect("submit");
} }
tx.inner.commit().unwrap(); tx.inner.commit().unwrap()
}); });
} }
db db
@ -214,7 +214,7 @@ where
tx.put::<T>(k, v).expect("submit"); tx.put::<T>(k, v).expect("submit");
} }
tx.inner.commit().unwrap(); tx.inner.commit().unwrap()
}); });
} }
db db