From 553357c3150eb9531a980f0d010ef0c95d264b0e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafael=20=C3=81vila=20de=20Esp=C3=ADndola?= Date: Tue, 26 Dec 2023 16:57:29 -0100 Subject: [PATCH] Delete GetConnInner::take It is only used in GetConn::drop and not actually needed in there. --- src/conn/pool/futures/get_conn.rs | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/src/conn/pool/futures/get_conn.rs b/src/conn/pool/futures/get_conn.rs index 166bf7a7..ce7faa78 100644 --- a/src/conn/pool/futures/get_conn.rs +++ b/src/conn/pool/futures/get_conn.rs @@ -55,13 +55,6 @@ impl fmt::Debug for GetConnInner { } } -impl GetConnInner { - /// Take the value of the inner connection, resetting it to `New`. - pub fn take(&mut self) -> GetConnInner { - std::mem::replace(self, GetConnInner::New) - } -} - /// This future will take connection from a pool and resolve to [`Conn`]. #[derive(Debug)] #[must_use = "futures do nothing unless you `.await` or poll them"] @@ -186,7 +179,7 @@ impl Drop for GetConn { // Remove the waker from the pool's waitlist in case this task was // woken by another waker, like from tokio::time::timeout. pool.unqueue(self.queue_id); - if let GetConnInner::Connecting(..) = self.inner.take() { + if let GetConnInner::Connecting(..) = self.inner { pool.cancel_connection(); } }