Skip to content

Commit

Permalink
async/consumer: fix WaitOccupiedFuture fused impl
Browse files Browse the repository at this point in the history
  • Loading branch information
BiagioFesta committed Jan 22, 2025
1 parent 0579d48 commit 4fea746
Showing 1 changed file with 2 additions and 1 deletion.
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

0 comments on commit 4fea746

Please sign in to comment.