Skip to content

Commit 4cc9469

Browse files
authored
Merge pull request #44 from BiagioFesta/wip/bfesta/fix-fused
async/consumer: fix WaitOccupiedFuture fused impl
2 parents 0579d48 + 4fea746 commit 4cc9469

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

async/src/traits/consumer.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -248,12 +248,13 @@ impl<A: AsyncConsumer> FusedFuture for WaitOccupiedFuture<'_, A> {
248248
impl<A: AsyncConsumer> Future for WaitOccupiedFuture<'_, A> {
249249
type Output = ();
250250

251-
fn poll(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Self::Output> {
251+
fn poll(mut self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Self::Output> {
252252
let mut waker_registered = false;
253253
loop {
254254
assert!(!self.done);
255255
let closed = self.owner.is_closed();
256256
if self.count <= self.owner.occupied_len() || closed {
257+
self.done = true;
257258
break Poll::Ready(());
258259
}
259260
if waker_registered {

0 commit comments

Comments
 (0)