File tree Expand file tree Collapse file tree 1 file changed +10
-9
lines changed Expand file tree Collapse file tree 1 file changed +10
-9
lines changed Original file line number Diff line number Diff line change @@ -100,16 +100,17 @@ where
100
100
101
101
fn poll ( mut self : Pin < & mut Self > , cx : & mut Context < ' _ > ) -> Poll < Self :: Output > {
102
102
let ( mut a, mut b) = self . inner . take ( ) . expect ( "cannot poll Select twice" ) ;
103
- match a. poll_unpin ( cx) {
104
- Poll :: Ready ( x) => Poll :: Ready ( Either :: Left ( ( x, b) ) ) ,
105
- Poll :: Pending => match b. poll_unpin ( cx) {
106
- Poll :: Ready ( x) => Poll :: Ready ( Either :: Right ( ( x, a) ) ) ,
107
- Poll :: Pending => {
108
- self . inner = Some ( ( a, b) ) ;
109
- Poll :: Pending
110
- }
111
- } ,
103
+
104
+ if let Poll :: Ready ( val) = a. poll_unpin ( cx) {
105
+ return Poll :: Ready ( Either :: Left ( ( val, b) ) ) ;
106
+ }
107
+
108
+ if let Poll :: Ready ( val) = b. poll_unpin ( cx) {
109
+ return Poll :: Ready ( Either :: Right ( ( val, a) ) ) ;
112
110
}
111
+
112
+ self . inner = Some ( ( a, b) ) ;
113
+ Poll :: Pending
113
114
}
114
115
}
115
116
You can’t perform that action at this time.
0 commit comments