diff --git a/p2p/p2p/src/block_downloader/request_chain.rs b/p2p/p2p/src/block_downloader/request_chain.rs index 70edc29..bde40ce 100644 --- a/p2p/p2p/src/block_downloader/request_chain.rs +++ b/p2p/p2p/src/block_downloader/request_chain.rs @@ -179,7 +179,7 @@ where Some(res) => { // res has already been set, replace it if this peer claims higher cumulative difficulty if res.0.cumulative_difficulty() < task_res.0.cumulative_difficulty() { - let _unused = mem::replace(res, task_res); + drop(mem::replace(res, task_res)); } } None => { diff --git a/p2p/p2p/src/broadcast.rs b/p2p/p2p/src/broadcast.rs index 725b761..c314c74 100644 --- a/p2p/p2p/src/broadcast.rs +++ b/p2p/p2p/src/broadcast.rs @@ -193,7 +193,7 @@ impl Service> for BroadcastSvc { }; // An error here means _all_ receivers were dropped which we assume will never happen. - let _unused = match direction { + drop(match direction { Some(ConnectionDirection::Inbound) => { self.tx_broadcast_channel_inbound.send(nex_tx_info) } @@ -201,10 +201,10 @@ impl Service> for BroadcastSvc { self.tx_broadcast_channel_outbound.send(nex_tx_info) } None => { - let _unused = self.tx_broadcast_channel_outbound.send(nex_tx_info.clone()); + drop(self.tx_broadcast_channel_outbound.send(nex_tx_info.clone())); self.tx_broadcast_channel_inbound.send(nex_tx_info) } - }; + }); } } @@ -336,10 +336,9 @@ impl Stream for BroadcastMessageStream { Poll::Ready(Some(BroadcastMessage::NewTransaction(txs))) } else { tracing::trace!("Diffusion flush timer expired but no txs to diffuse"); - #[expect( - clippy::let_underscore_must_use, - reason = "poll next_flush now to register the waker with it. the waker will already be registered with the block broadcast channel." - )] + // poll next_flush now to register the waker with it. + // the waker will already be registered with the block broadcast channel." + #[expect(clippy::let_underscore_must_use)] let _ = this.next_flush.poll(cx); Poll::Pending } diff --git a/p2p/p2p/src/client_pool.rs b/p2p/p2p/src/client_pool.rs index a455d73..3405224 100644 --- a/p2p/p2p/src/client_pool.rs +++ b/p2p/p2p/src/client_pool.rs @@ -8,7 +8,7 @@ //! returns the peer to the pool when it is dropped. //! //! Internally the pool is a [`DashMap`] which means care should be taken in `async` code -//! as internally this uses blocking `RwLocks`. +//! as internally this uses blocking `RwLock`s. use std::sync::Arc; use dashmap::DashMap;