mirror of
https://github.com/fluencelabs/rust-libp2p
synced 2025-06-24 07:11:38 +00:00
core: fix clippy::op-ref, clippy::needless-borrow (#2770)
This commit is contained in:
@ -157,7 +157,7 @@ impl PublicKey {
|
|||||||
let buf = Self::del_asn1_header(k).ok_or_else(|| {
|
let buf = Self::del_asn1_header(k).ok_or_else(|| {
|
||||||
DecodingError::new("failed to parse asn.1 encoded ecdsa p256 public key")
|
DecodingError::new("failed to parse asn.1 encoded ecdsa p256 public key")
|
||||||
})?;
|
})?;
|
||||||
Self::from_bytes(&buf)
|
Self::from_bytes(buf)
|
||||||
}
|
}
|
||||||
|
|
||||||
// ecPublicKey (ANSI X9.62 public key type) OID: 1.2.840.10045.2.1
|
// ecPublicKey (ANSI X9.62 public key type) OID: 1.2.840.10045.2.1
|
||||||
@ -198,8 +198,8 @@ impl PublicKey {
|
|||||||
if asn1_head[0] != 0x30
|
if asn1_head[0] != 0x30
|
||||||
|| asn1_head[2] != 0x30
|
|| asn1_head[2] != 0x30
|
||||||
|| asn1_head[3] as usize != oids_len
|
|| asn1_head[3] as usize != oids_len
|
||||||
|| &oids_buf[..Self::EC_PUBLIC_KEY_OID.len()] != &Self::EC_PUBLIC_KEY_OID
|
|| oids_buf[..Self::EC_PUBLIC_KEY_OID.len()] != Self::EC_PUBLIC_KEY_OID
|
||||||
|| &oids_buf[Self::EC_PUBLIC_KEY_OID.len()..] != &Self::SECP_256_R1_OID
|
|| oids_buf[Self::EC_PUBLIC_KEY_OID.len()..] != Self::SECP_256_R1_OID
|
||||||
|| bitstr_head[0] != 0x03
|
|| bitstr_head[0] != 0x03
|
||||||
|| bitstr_head[2] != 0x00
|
|| bitstr_head[2] != 0x00
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user