diff options
| author | mitchmindtree <mitchell.nordine@gmail.com> | 2016-07-21 19:32:24 +1000 |
|---|---|---|
| committer | mitchmindtree <mitchell.nordine@gmail.com> | 2016-07-21 19:32:24 +1000 |
| commit | 05af033b7fec63638497a9780e6b323d327d1e17 (patch) | |
| tree | 837321b6a6744400a497c08dbe2e36da3c5004f8 /src/libstd/sync | |
| parent | aed2e5c1e5d1774fba671ba60ee6347a1d524f2e (diff) | |
| download | rust-05af033b7fec63638497a9780e6b323d327d1e17.tar.gz rust-05af033b7fec63638497a9780e6b323d327d1e17.zip | |
Fix issue in receiver_try_iter test where response sender would panic instead of break from the loop
Diffstat (limited to 'src/libstd/sync')
| -rw-r--r-- | src/libstd/sync/mpsc/mod.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/libstd/sync/mpsc/mod.rs b/src/libstd/sync/mpsc/mod.rs index b862a594ed2..6fe1b2a3b47 100644 --- a/src/libstd/sync/mpsc/mod.rs +++ b/src/libstd/sync/mpsc/mod.rs @@ -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); |
