aboutsummaryrefslogtreecommitdiff
path: root/p2p
diff options
context:
space:
mode:
authorhozan23 <hozan23@proton.me>2023-11-17 15:45:46 +0300
committerhozan23 <hozan23@proton.me>2023-11-17 15:45:46 +0300
commitf04ba793bbc15d021444c5010aaf0e4bae655ce0 (patch)
tree86dfc732650bb3958c4d9903e97121e3aa284c6d /p2p
parent44969b25504a4c91f45cac902f264579e8b90ca8 (diff)
p2p/peer_pool: minor change
Diffstat (limited to 'p2p')
-rw-r--r--p2p/src/peer_pool.rs5
1 files changed, 1 insertions, 4 deletions
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,