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

Fixes redundant todo! #176

Merged
merged 1 commit into from
Apr 12, 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
10 changes: 9 additions & 1 deletion src/concurrent_stream/try_for_each.rs
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,17 @@ where
// If we have no space, we're going to provide backpressure until we have space
while this.count.load(Ordering::Relaxed) >= *this.limit {
match this.group.next().await {
// Case 1: there are no more items available in the group. We
// can no longer iterate over them, and necessarily should be
// able to insert.
None => break,
Some(res) => match res.branch() {
ControlFlow::Continue(_) => todo!(),
// Case 2: We got more data and no error, try to loop again.
ControlFlow::Continue(_) => continue,

// Case 3: We got an error of some kind, stop iterating
// entirely so we can short-circuit with an error from the
// `flush` method.
ControlFlow::Break(residual) => {
*this.residual = Some(residual);
return ConsumerState::Break;
Expand Down
Loading