Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Delete GetConnInner::take #279

Merged
merged 1 commit into from
Jan 5, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading