From f04ba793bbc15d021444c5010aaf0e4bae655ce0 Mon Sep 17 00:00:00 2001 From: hozan23 Date: Fri, 17 Nov 2023 15:45:46 +0300 Subject: p2p/peer_pool: minor change --- p2p/src/peer_pool.rs | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'p2p/src') diff --git a/p2p/src/peer_pool.rs b/p2p/src/peer_pool.rs index 0d17307..e2a9de7 100644 --- a/p2p/src/peer_pool.rs +++ b/p2p/src/peer_pool.rs @@ -210,10 +210,7 @@ impl PeerPool { /// Shuts down the peer and remove it from the peer list. async fn remove_peer(&self, pid: &PeerID) -> Result<()> { - let mut peers = self.peers.lock().await; - let result = peers.remove(pid); - - drop(peers); + let result = self.peers.lock().await.remove(pid); let peer = match result { Some(p) => p, -- cgit v1.2.3