File tree Expand file tree Collapse file tree 4 files changed +16
-17
lines changed Expand file tree Collapse file tree 4 files changed +16
-17
lines changed Original file line number Diff line number Diff line change @@ -45,16 +45,14 @@ where
4545 let mut left = this. left ;
4646 let mut right = this. right ;
4747
48- if Future :: poll ( Pin :: new ( & mut left) , cx) . is_ready ( ) {
49- if right. as_ref ( ) . output ( ) . is_some ( ) {
50- return Poll :: Ready ( ( left. take ( ) . unwrap ( ) , right. take ( ) . unwrap ( ) ) ) ;
51- }
48+ let is_left_ready = Future :: poll ( Pin :: new ( & mut left) , cx) . is_ready ( ) ;
49+ if is_left_ready && right. as_ref ( ) . output ( ) . is_some ( ) {
50+ return Poll :: Ready ( ( left. take ( ) . unwrap ( ) , right. take ( ) . unwrap ( ) ) ) ;
5251 }
5352
54- if Future :: poll ( Pin :: new ( & mut right) , cx) . is_ready ( ) {
55- if left. as_ref ( ) . output ( ) . is_some ( ) {
56- return Poll :: Ready ( ( left. take ( ) . unwrap ( ) , right. take ( ) . unwrap ( ) ) ) ;
57- }
53+ let is_right_ready = Future :: poll ( Pin :: new ( & mut right) , cx) . is_ready ( ) ;
54+ if is_right_ready && left. as_ref ( ) . output ( ) . is_some ( ) {
55+ return Poll :: Ready ( ( left. take ( ) . unwrap ( ) , right. take ( ) . unwrap ( ) ) ) ;
5856 }
5957
6058 Poll :: Pending
Original file line number Diff line number Diff line change 1- use std:: pin:: Pin ;
21use std:: future:: Future ;
2+ use std:: pin:: Pin ;
33
44use pin_project_lite:: pin_project;
55
Original file line number Diff line number Diff line change 1+ use pin_project_lite:: pin_project;
2+ use std:: default:: Default ;
13use std:: future:: Future ;
24use std:: pin:: Pin ;
3- use std:: default:: Default ;
4- use pin_project_lite:: pin_project;
55
66use crate :: stream:: Stream ;
77use crate :: task:: { Context , Poll } ;
88
99pin_project ! {
1010 #[ derive( Debug ) ]
11- #[ allow( missing_debug_implementations) ]
1211 #[ cfg( all( feature = "default" , feature = "unstable" ) ) ]
1312 #[ cfg_attr( feature = "docs" , doc( cfg( unstable) ) ) ]
1413 pub struct PartitionFuture <S , F , B > {
@@ -46,10 +45,12 @@ where
4645 match next {
4746 Some ( v) => {
4847 let res = this. res . as_mut ( ) . unwrap ( ) ;
49- match ( this. f ) ( & v) {
50- true => res. 0 . extend ( Some ( v) ) ,
51- false => res. 1 . extend ( Some ( v) ) ,
52- } ;
48+
49+ if ( this. f ) ( & v) {
50+ res. 0 . extend ( Some ( v) )
51+ } else {
52+ res. 1 . extend ( Some ( v) )
53+ }
5354 }
5455 None => return Poll :: Ready ( this. res . take ( ) . unwrap ( ) ) ,
5556 }
Original file line number Diff line number Diff line change @@ -43,7 +43,7 @@ static POOL: Lazy<Pool> = Lazy::new(|| {
4343 . name ( "async-std/executor" . to_string ( ) )
4444 . spawn ( || {
4545 let _ = PROCESSOR . with ( |p| p. set ( proc) ) ;
46- abort_on_panic ( || main_loop ( ) ) ;
46+ abort_on_panic ( main_loop) ;
4747 } )
4848 . expect ( "cannot start a thread driving tasks" ) ;
4949 }
You can’t perform that action at this time.
0 commit comments