Skip to content

Commit

Permalink
use exhaustive match
Browse files Browse the repository at this point in the history
  • Loading branch information
hdevalence committed Dec 15, 2022
1 parent daff843 commit 726c637
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions p2p/src/secret_connection.rs
Original file line number Diff line number Diff line change
Expand Up @@ -183,13 +183,12 @@ impl Handshake<AwaitingAuthSig> {
.and_then(|key| key.sum)
.ok_or_else(Error::missing_key)?;

#[allow(clippy::match_wildcard_for_single_variants)]
let remote_pubkey = match pk_sum {
proto::crypto::public_key::Sum::Ed25519(ref bytes) => {
ed25519_consensus::VerificationKey::try_from(&bytes[..])
.map_err(|_| Error::signature())
},
_ => Err(Error::unsupported_key()),
proto::crypto::public_key::Sum::Secp256k1(_) => Err(Error::unsupported_key()),
}?;

let remote_sig = ed25519_consensus::Signature::try_from(auth_sig_msg.sig.as_slice())
Expand Down

0 comments on commit 726c637

Please sign in to comment.