]> git.lizzy.rs Git - rust.git/commitdiff
Fix issue in receiver_try_iter test where response sender would panic instead of...
authormitchmindtree <mitchell.nordine@gmail.com>
Thu, 21 Jul 2016 09:32:24 +0000 (19:32 +1000)
committermitchmindtree <mitchell.nordine@gmail.com>
Thu, 21 Jul 2016 09:32:24 +0000 (19:32 +1000)
src/libstd/sync/mpsc/mod.rs

index b862a594ed2107b3ce5985c04568a1e0da3319d4..6fe1b2a3b47de09e013b49e4d9e41aec248f346e 100644 (file)
@@ -1854,8 +1854,6 @@ fn test_recv_try_iter() {
                 for x in response_rx.try_iter() {
                     count += x;
                     if count == 6 {
-                        drop(response_rx);
-                        drop(request_tx);
                         return count;
                     }
                 }
@@ -1864,7 +1862,9 @@ fn test_recv_try_iter() {
         });
 
         for _ in request_rx.iter() {
-            response_tx.send(2).unwrap();
+            if response_tx.send(2).is_err() {
+                break;
+            }
         }
 
         assert_eq!(t.join().unwrap(), 6);