Skip to content

Commit

Permalink
Fix issue in receiver_try_iter test where response sender would panic…
Browse files Browse the repository at this point in the history
… instead of break from the loop
  • Loading branch information
mitchmindtree committed Jul 21, 2016
1 parent aed2e5c commit 05af033
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/libstd/sync/mpsc/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1854,8 +1854,6 @@ mod tests {
for x in response_rx.try_iter() {
count += x;
if count == 6 {
drop(response_rx);
drop(request_tx);
return count;
}
}
Expand All @@ -1864,7 +1862,9 @@ mod tests {
});

for _ in request_rx.iter() {
response_tx.send(2).unwrap();
if response_tx.send(2).is_err() {
break;
}
}

assert_eq!(t.join().unwrap(), 6);
Expand Down

0 comments on commit 05af033

Please sign in to comment.