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

async/consumer: fix WaitOccupiedFuture fused impl #44

Merged
merged 1 commit into from
Jan 24, 2025
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
3 changes: 2 additions & 1 deletion async/src/traits/consumer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -248,12 +248,13 @@ impl<A: AsyncConsumer> FusedFuture for WaitOccupiedFuture<'_, A> {
impl<A: AsyncConsumer> Future for WaitOccupiedFuture<'_, A> {
type Output = ();

fn poll(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Self::Output> {
fn poll(mut self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Self::Output> {
let mut waker_registered = false;
loop {
assert!(!self.done);
let closed = self.owner.is_closed();
if self.count <= self.owner.occupied_len() || closed {
self.done = true;
break Poll::Ready(());
}
if waker_registered {
Expand Down
Loading