Skip to content

Commit cacf7cb

Browse files
committed
Fixes redundant todo!
1 parent 6949e9b commit cacf7cb

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

src/concurrent_stream/try_for_each.rs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,9 +71,17 @@ where
7171
// If we have no space, we're going to provide backpressure until we have space
7272
while this.count.load(Ordering::Relaxed) >= *this.limit {
7373
match this.group.next().await {
74+
// Case 1: there are no more items available in the group. We
75+
// can no longer iterate over them, and necessarily should be
76+
// able to insert.
7477
None => break,
7578
Some(res) => match res.branch() {
76-
ControlFlow::Continue(_) => todo!(),
79+
// Case 2: We got more data and no error, try to loop again.
80+
ControlFlow::Continue(_) => continue,
81+
82+
// Case 3: We got an error of some kind, stop iterating
83+
// entirely so we can short-circuit with an error from the
84+
// `flush` method.
7785
ControlFlow::Break(residual) => {
7886
*this.residual = Some(residual);
7987
return ConsumerState::Break;

0 commit comments

Comments
 (0)