Skip to content

Commit

Permalink
reset-current-batch-size-with-each-items-reset
Browse files Browse the repository at this point in the history
  • Loading branch information
pragmaxim committed Jun 11, 2024
1 parent 0320f5b commit 0b170f6
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,7 @@ where
let last = if me.items.is_empty() {
None
} else {
*me.current_batch_size = 0;
Some(std::mem::take(me.items))
};

Expand All @@ -147,6 +148,7 @@ where
}

if !me.items.is_empty() {
*me.current_batch_size = 0;
return Poll::Ready(Some(std::mem::take(me.items)));
}

Expand Down

0 comments on commit 0b170f6

Please sign in to comment.