*: 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

@ -296,7 +296,7 @@ impl NetworkBehaviour for Relay {
.push_back(NetworkBehaviourAction::NotifyHandler {
peer_id: *peer_id,
handler: NotifyHandler::Any,
event: event,
event,
});
}
}
@ -640,7 +640,7 @@ impl NetworkBehaviour for Relay {
dst_peer_id,
send_back,
})) => {
if let Some(_) = self.connected_peers.get(&relay_peer_id) {
if self.connected_peers.get(&relay_peer_id).is_some() {
// In case we are already listening via the relay,
// prefer the primary connection.
let handler = self

View File

@ -50,10 +50,7 @@ pub struct IncomingDstReq {
impl IncomingDstReq {
/// Creates a `IncomingDstReq`.
pub(crate) fn new(stream: Framed<NegotiatedSubstream, UviBytes>, src: Peer) -> Self {
IncomingDstReq {
stream: stream,
src,
}
IncomingDstReq { stream, src }
}
/// Returns the peer id of the source that is being relayed.