Skip to content

Commit

Permalink
Remove unnecessary mut (#5318)
Browse files Browse the repository at this point in the history
Trivial leftover from
#4844

Co-authored-by: Adrian Catangiu <adrian@parity.io>
Co-authored-by: Bastian Köcher <git@kchr.de>
  • Loading branch information
3 people authored Aug 12, 2024
1 parent b52cfc2 commit bcc9673
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 9 deletions.
4 changes: 2 additions & 2 deletions substrate/client/consensus/common/src/import_queue.rs
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ pub async fn import_single_block<B: BlockT, V: Verifier<B>>(
import_handle: &mut impl BlockImport<B, Error = ConsensusError>,
block_origin: BlockOrigin,
block: IncomingBlock<B>,
verifier: &mut V,
verifier: &V,
) -> BlockImportResult<B> {
match verify_single_block_metered(import_handle, block_origin, block, verifier, None).await? {
SingleBlockVerificationOutcome::Imported(import_status) => Ok(import_status),
Expand Down Expand Up @@ -295,7 +295,7 @@ pub(crate) async fn verify_single_block_metered<B: BlockT, V: Verifier<B>>(
import_handle: &impl BlockImport<B, Error = ConsensusError>,
block_origin: BlockOrigin,
block: IncomingBlock<B>,
verifier: &mut V,
verifier: &V,
metrics: Option<&Metrics>,
) -> Result<SingleBlockVerificationOutcome<B>, BlockImportError> {
let peer = block.origin;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ mod worker_messages {
/// Returns when `block_import` ended.
async fn block_import_process<B: BlockT>(
mut block_import: BoxBlockImport<B>,
mut verifier: impl Verifier<B>,
verifier: impl Verifier<B>,
mut result_sender: BufferedLinkSender<B>,
mut block_import_receiver: TracingUnboundedReceiver<worker_messages::ImportBlocks<B>>,
metrics: Option<Metrics>,
Expand All @@ -241,8 +241,7 @@ async fn block_import_process<B: BlockT>(
};

let res =
import_many_blocks(&mut block_import, origin, blocks, &mut verifier, metrics.clone())
.await;
import_many_blocks(&mut block_import, origin, blocks, &verifier, metrics.clone()).await;

result_sender.blocks_processed(res.imported, res.block_count, res.results);
}
Expand Down Expand Up @@ -388,7 +387,7 @@ async fn import_many_blocks<B: BlockT, V: Verifier<B>>(
import_handle: &mut BoxBlockImport<B>,
blocks_origin: BlockOrigin,
blocks: Vec<IncomingBlock<B>>,
verifier: &mut V,
verifier: &V,
metrics: Option<Metrics>,
) -> ImportManyBlocksResult<B> {
let count = blocks.len();
Expand Down
6 changes: 3 additions & 3 deletions substrate/client/network/test/src/block_import.rs
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ fn import_single_good_block_works() {
&mut substrate_test_runtime_client::new(),
BlockOrigin::File,
block,
&mut PassThroughVerifier::new(true),
&PassThroughVerifier::new(true),
)) {
Ok(BlockImportStatus::ImportedUnknown(ref num, ref aux, ref org))
if *num == number && *aux == expected_aux && *org == Some(peer_id.into()) => {},
Expand All @@ -93,7 +93,7 @@ fn import_single_good_known_block_is_ignored() {
&mut client,
BlockOrigin::File,
block,
&mut PassThroughVerifier::new(true),
&PassThroughVerifier::new(true),
)) {
Ok(BlockImportStatus::ImportedKnown(ref n, _)) if *n == number => {},
_ => panic!(),
Expand All @@ -108,7 +108,7 @@ fn import_single_good_block_without_header_fails() {
&mut substrate_test_runtime_client::new(),
BlockOrigin::File,
block,
&mut PassThroughVerifier::new(true),
&PassThroughVerifier::new(true),
)) {
Err(BlockImportError::IncompleteHeader(ref org)) if *org == Some(peer_id.into()) => {},
_ => panic!(),
Expand Down

0 comments on commit bcc9673

Please sign in to comment.