Skip to content

Commit

Permalink
Merge pull request #176 from yoshuawuyts/remove-todo
Browse files Browse the repository at this point in the history
Fixes redundant `todo!`
  • Loading branch information
yoshuawuyts authored Apr 12, 2024
2 parents 6949e9b + cacf7cb commit 28d7098
Showing 1 changed file with 9 additions and 1 deletion.
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

0 comments on commit 28d7098

Please sign in to comment.