Fix minor clippy lints in grandpa (#5988)

* grandpa: fix clippy lints about identity conversions

* grandpa: fix clippy lints about unwrap_or_default

* grandpa: fix clippy lints about explicit return

* grandpa: fix clippy lints about unnecessary intermediary

* grandpa: fix clippy lints about to_string

* grandpa: fix clippy lints about unused imports

* grandpa: fix clippy lints about increments

* grandpa: fix clippy lints about unnecessary matches

* grandpa: fix clippy lints about struct arguments

* Fix clippy::redundant_clone

* Fix clippy::clone_on_copy

* Fix clippy::or_fun_call

* Fix clippy::identity_conversion
This commit is contained in:
Jon Häggblad
2020-05-13 18:40:52 +02:00
committed by GitHub
parent 10492c0689
commit b99033368b
14 changed files with 53 additions and 58 deletions
@@ -169,7 +169,7 @@ impl<BE, Block: BlockT, Client> FinalityProofImport<Block>
if *pending_number > chain_info.finalized_number
&& *pending_number <= chain_info.best_number
{
out.push((pending_hash.clone(), *pending_number));
out.push((*pending_hash, *pending_number));
}
}
@@ -253,7 +253,7 @@ fn do_import_block<B, C, Block: BlockT, J>(
J: ProvableJustification<Block::Header>,
{
let hash = block.post_hash();
let number = block.header.number().clone();
let number = *block.header.number();
// we don't want to finalize on `inner.import_block`
let justification = block.justification.take();
@@ -263,7 +263,7 @@ fn do_import_block<B, C, Block: BlockT, J>(
let mut imported_aux = match import_result {
Ok(ImportResult::Imported(aux)) => aux,
Ok(r) => return Ok(r),
Err(e) => return Err(ConsensusError::ClientImport(e.to_string()).into()),
Err(e) => return Err(ConsensusError::ClientImport(e.to_string())),
};
match justification {
@@ -435,7 +435,7 @@ fn do_import_justification<B, C, Block: BlockT, J>(
hash,
);
return Err(ConsensusError::ClientImport(e.to_string()).into());
return Err(ConsensusError::ClientImport(e.to_string()));
},
Ok(justification) => {
trace!(