*: Fix clippy warnings (#2227)

This commit is contained in:
Roman
2021-09-14 16:00:05 +03:00
committed by GitHub
parent 5f68c74177
commit b79fd02f0b
25 changed files with 93 additions and 124 deletions

View File

@ -194,7 +194,7 @@ impl GossipsubCodec {
}
};
let source = match PeerId::from_bytes(&from) {
let source = match PeerId::from_bytes(from) {
Ok(v) => v,
Err(_) => {
debug!("Signature verification failed: Invalid Peer Id");
@ -214,8 +214,8 @@ impl GossipsubCodec {
// obtained from the inlined source peer_id.
let public_key = match message
.key
.as_ref()
.map(|key| PublicKey::from_protobuf_encoding(&key))
.as_deref()
.map(PublicKey::from_protobuf_encoding)
{
Some(Ok(key)) => key,
_ => match PublicKey::from_protobuf_encoding(&source.to_bytes()[2..]) {