mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-02 07:22:42 +00:00
Fix issue in receiver_try_iter test where response sender would panic instead of break from the loop
This commit is contained in:
parent
aed2e5c1e5
commit
05af033b7f
@ -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;
|
||||
}
|
||||
}
|
||||
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user