File tree Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change 1+ use std:: iter;
12use std:: sync:: Arc ;
23
34use futures:: channel:: mpsc;
@@ -299,13 +300,16 @@ fn flatten_unordered() {
299300
300301 // stream panics
301302 {
302- let st = once ( async { once ( async { panic ! ( "Polled" ) } ) . boxed ( ) } . boxed ( ) ) . chain (
303+ let st = stream:: iter ( iter:: once (
304+ once ( Box :: pin ( async { panic ! ( "Polled" ) } ) ) . left_stream :: < DataStream > ( ) ,
305+ ) )
306+ . chain (
303307 Interchanger { polled : false , base : 0 , wake_immediately : true }
304- . then ( |val| async move { val . boxed ( ) } . boxed ( ) )
308+ . map ( |stream| stream . right_stream ( ) )
305309 . take ( 10 ) ,
306310 ) ;
307311
308- let stream = Arc :: new ( Mutex :: new ( st. boxed ( ) . flat_map_unordered ( 10 , |s| s . map ( identity ) ) ) ) ;
312+ let stream = Arc :: new ( Mutex :: new ( st. flatten_unordered ( 10 ) ) ) ;
309313
310314 std:: thread:: spawn ( {
311315 let stream = stream. clone ( ) ;
You can’t perform that action at this time.
0 commit comments