Fix issue in receiver_try_iter test where response sender would panic instead of break from the loop

This commit is contained in:
mitchmindtree 2016-07-21 19:32:24 +10:00
parent aed2e5c1e5
commit 05af033b7f

View File

@ -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);