Fix updated clippy grumbles (#733)

* Revert "Pin Rust Nightly to 2020-12-17 (#652)"

This reverts commit e54e6f7e3d34c28d698e637f9099162b3c1917e9.

* fix clippy

* clippy again

* more clippy in test code

* and new cargo fmt

* another try
This commit is contained in:
Svyatoslav Nikolsky
2021-02-17 15:38:25 +03:00
committed by Bastian Köcher
parent 85bb45b5d3
commit 90113303f1
14 changed files with 31 additions and 11 deletions
@@ -48,7 +48,7 @@ pub enum Error {
pub fn decode_justification_target<Header: HeaderT>(
raw_justification: &[u8],
) -> Result<(Header::Hash, Header::Number), Error> {
GrandpaJustification::<Header>::decode(&mut &raw_justification[..])
GrandpaJustification::<Header>::decode(&mut &*raw_justification)
.map(|justification| (justification.commit.target_hash, justification.commit.target_number))
.map_err(|_| Error::JustificationDecode)
}
@@ -65,7 +65,7 @@ where
{
// Decode justification first
let justification =
GrandpaJustification::<Header>::decode(&mut &raw_justification[..]).map_err(|_| Error::JustificationDecode)?;
GrandpaJustification::<Header>::decode(&mut &*raw_justification).map_err(|_| Error::JustificationDecode)?;
// Ensure that it is justification for the expected header
if (justification.commit.target_hash, justification.commit.target_number) != finalized_target {