Skip to content

Commit

Permalink
p2p: fix cargo clippy warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
hozan23 committed Jun 1, 2024
1 parent 9dd15ea commit 36eae63
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
10 changes: 5 additions & 5 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions p2p/src/discovery/lookup.rs
Original file line number Diff line number Diff line change
Expand Up @@ -345,7 +345,7 @@ impl LookupService {
/// Sends a Pong msg
async fn send_pong_msg(&self, nonce: [u8; 32], conn: &Conn<NetMsg>) -> Result<()> {
trace!("Send Pong msg");
conn.send(NetMsg::new(NetMsgCmd::Pong, &PongMsg(nonce))?)
conn.send(NetMsg::new(NetMsgCmd::Pong, PongMsg(nonce))?)
.await?;
Ok(())
}
Expand All @@ -355,7 +355,7 @@ impl LookupService {
trace!("Send FindPeer msg");
conn.send(NetMsg::new(
NetMsgCmd::FindPeer,
&FindPeerMsg(peer_id.clone()),
FindPeerMsg(peer_id.clone()),
)?)
.await?;

Expand All @@ -376,7 +376,7 @@ impl LookupService {
.closest_entries(&peer_id.0, MAX_PEERS_IN_PEERSMSG);

let peers: Vec<PeerMsg> = entries.into_iter().map(|e| e.into()).collect();
conn.send(NetMsg::new(NetMsgCmd::Peers, &PeersMsg(peers))?)
conn.send(NetMsg::new(NetMsgCmd::Peers, PeersMsg(peers))?)
.await?;
Ok(())
}
Expand All @@ -397,7 +397,7 @@ impl LookupService {
/// Sends a Shutdown msg.
async fn send_shutdown_msg(&self, conn: &Conn<NetMsg>) -> Result<()> {
trace!("Send Shutdown msg");
conn.send(NetMsg::new(NetMsgCmd::Shutdown, &ShutdownMsg(0))?)
conn.send(NetMsg::new(NetMsgCmd::Shutdown, ShutdownMsg(0))?)
.await?;
Ok(())
}
Expand Down
2 changes: 1 addition & 1 deletion p2p/src/peer/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ impl Peer {

// No need to handle the error here
let shutdown_msg =
NetMsg::new(NetMsgCmd::Shutdown, &ShutdownMsg(0)).expect("pack shutdown message");
NetMsg::new(NetMsgCmd::Shutdown, ShutdownMsg(0)).expect("pack shutdown message");
let _ = self.conn.send(shutdown_msg).await;

// Force shutting down
Expand Down

0 comments on commit 36eae63

Please sign in to comment.