mirror of
https://github.com/fluencelabs/rust-libp2p
synced 2025-06-29 01:31:33 +00:00
Make clippy "happy". (#1950)
* Make clippy "happy". Address all clippy complaints that are not purely stylistic (or even have corner cases with false positives). Ignore all "style" and "pedantic" lints. * Fix tests. * Undo unnecessary API change.
This commit is contained in:
@ -117,7 +117,7 @@ impl NetworkBehaviour for Identify {
|
||||
ConnectedPoint::Listener { send_back_addr, .. } => send_back_addr.clone(),
|
||||
};
|
||||
|
||||
self.observed_addresses.entry(peer_id.clone()).or_default().insert(*conn, addr);
|
||||
self.observed_addresses.entry(*peer_id).or_default().insert(*conn, addr);
|
||||
}
|
||||
|
||||
fn inject_connection_closed(&mut self, peer_id: &PeerId, conn: &ConnectionId, _: &ConnectedPoint) {
|
||||
|
@ -35,13 +35,12 @@ use std::{fmt, io, iter, pin::Pin};
|
||||
pub struct IdentifyProtocolConfig;
|
||||
|
||||
#[derive(Debug, Clone)]
|
||||
#[non_exhaustive]
|
||||
pub struct RemoteInfo {
|
||||
/// Information about the remote.
|
||||
pub info: IdentifyInfo,
|
||||
/// Address the remote sees for us.
|
||||
pub observed_addr: Multiaddr,
|
||||
|
||||
_priv: ()
|
||||
}
|
||||
|
||||
/// The substream on which a reply is expected to be sent.
|
||||
@ -80,7 +79,7 @@ where
|
||||
agent_version: Some(info.agent_version),
|
||||
protocol_version: Some(info.protocol_version),
|
||||
public_key: Some(pubkey_bytes),
|
||||
listen_addrs: listen_addrs,
|
||||
listen_addrs,
|
||||
observed_addr: Some(observed_addr.to_vec()),
|
||||
protocols: info.protocols
|
||||
};
|
||||
@ -158,8 +157,7 @@ where
|
||||
|
||||
Ok(RemoteInfo {
|
||||
info,
|
||||
observed_addr: observed_addr.clone(),
|
||||
_priv: ()
|
||||
observed_addr,
|
||||
})
|
||||
})
|
||||
}
|
||||
|
Reference in New Issue
Block a user