mirror of
https://github.com/fluencelabs/rust-libp2p
synced 2025-07-02 19:21:37 +00:00
*: Fix clippy warnings (#2615)
This commit is contained in:
@ -263,7 +263,7 @@ impl DerDecodable<'_> for Asn1SubjectPublicKey {
|
||||
)));
|
||||
}
|
||||
|
||||
let pk_der: Vec<u8> = object.value().into_iter().skip(1).cloned().collect();
|
||||
let pk_der: Vec<u8> = object.value().iter().skip(1).cloned().collect();
|
||||
// We don't parse pk_der further as an ASN.1 RsaPublicKey, since
|
||||
// we only need the DER encoding for `verify`.
|
||||
Ok(Self(PublicKey(pk_der)))
|
||||
|
@ -94,7 +94,7 @@ impl PeerId {
|
||||
/// In case the given [`Multiaddr`] ends with `/p2p/<peer-id>`, this function
|
||||
/// will return the encapsulated [`PeerId`], otherwise it will return `None`.
|
||||
pub fn try_from_multiaddr(address: &Multiaddr) -> Option<PeerId> {
|
||||
address.iter().last().map_or(None, |p| match p {
|
||||
address.iter().last().and_then(|p| match p {
|
||||
Protocol::P2p(hash) => PeerId::from_multihash(hash).ok(),
|
||||
_ => None,
|
||||
})
|
||||
|
@ -89,7 +89,7 @@ impl PeerRecord {
|
||||
};
|
||||
|
||||
let envelope = SignedEnvelope::new(
|
||||
&key,
|
||||
key,
|
||||
String::from(DOMAIN_SEP),
|
||||
PAYLOAD_TYPE.as_bytes().to_vec(),
|
||||
payload,
|
||||
|
@ -358,9 +358,9 @@ impl<T> Sink<T> for Chan<T> {
|
||||
}
|
||||
}
|
||||
|
||||
impl<T: AsRef<[u8]>> Into<RwStreamSink<Chan<T>>> for Chan<T> {
|
||||
fn into(self) -> RwStreamSink<Chan<T>> {
|
||||
RwStreamSink::new(self)
|
||||
impl<T: AsRef<[u8]>> From<Chan<T>> for RwStreamSink<Chan<T>> {
|
||||
fn from(channel: Chan<T>) -> RwStreamSink<Chan<T>> {
|
||||
RwStreamSink::new(channel)
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user