Skip to content

Commit

Permalink
chore: clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
CHr15F0x committed Nov 20, 2023
1 parent b8ac20d commit 30856a3
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
1 change: 1 addition & 0 deletions crates/p2p_stream/src/handler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -515,6 +515,7 @@ where
fn on_connection_event(
&mut self,
event: ConnectionEvent<
'_,
Self::InboundProtocol,
Self::OutboundProtocol,
Self::InboundOpenInfo,
Expand Down
13 changes: 7 additions & 6 deletions crates/p2p_stream/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ impl std::error::Error for InboundFailure {}
pub struct InboundRequestId(u64);

impl fmt::Display for InboundRequestId {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
write!(f, "{}", self.0)
}
}
Expand All @@ -221,7 +221,7 @@ impl fmt::Display for InboundRequestId {
pub struct OutboundRequestId(u64);

impl fmt::Display for OutboundRequestId {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
write!(f, "{}", self.0)
}
}
Expand Down Expand Up @@ -257,6 +257,7 @@ impl Config {
}

/// A request/streaming-response protocol for some message codec.
#[allow(clippy::type_complexity)]
pub struct Behaviour<TCodec>
where
TCodec: Codec + Clone + Send + 'static,
Expand Down Expand Up @@ -446,7 +447,7 @@ where
connection_id,
new,
..
}: AddressChange,
}: AddressChange<'_>,
) {
let new_address = match new {
ConnectedPoint::Dialer { address, .. } => Some(address.clone()),
Expand All @@ -471,7 +472,7 @@ where
connection_id,
remaining_established,
..
}: ConnectionClosed,
}: ConnectionClosed<'_>,
) {
let connections = self
.connected
Expand Down Expand Up @@ -508,7 +509,7 @@ where
}
}

fn on_dial_failure(&mut self, DialFailure { peer_id, .. }: DialFailure) {
fn on_dial_failure(&mut self, DialFailure { peer_id, .. }: DialFailure<'_>) {
if let Some(peer) = peer_id {
// If there are pending outgoing requests when a dial failure occurs,
// it is implied that we are not connected to the peer, since pending
Expand Down Expand Up @@ -624,7 +625,7 @@ where
Ok(handler)
}

fn on_swarm_event(&mut self, event: FromSwarm) {
fn on_swarm_event(&mut self, event: FromSwarm<'_>) {
match event {
FromSwarm::ConnectionEstablished(_) => {}
FromSwarm::ConnectionClosed(connection_closed) => {
Expand Down

0 comments on commit 30856a3

Please sign in to comment.