Skip to content

Commit

Permalink
Merge pull request #279 from espindola/drop-take
Browse files Browse the repository at this point in the history
Delete GetConnInner::take
  • Loading branch information
blackbeam authored Jan 5, 2024
2 parents f7eb3ac + 553357c commit e480a01
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions src/conn/pool/futures/get_conn.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
Expand Down Expand Up @@ -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();
}
}
Expand Down

0 comments on commit e480a01

Please sign in to comment.