File tree 1 file changed +5
-9
lines changed
1 file changed +5
-9
lines changed Original file line number Diff line number Diff line change @@ -184,20 +184,16 @@ impl Future for OnUpgrade {
184
184
type Output = Result < Upgraded , crate :: Error > ;
185
185
186
186
fn poll ( mut self : Pin < & mut Self > , cx : & mut task:: Context < ' _ > ) -> Poll < Self :: Output > {
187
- unimplemented ! ( )
188
- /*
189
187
match self . rx {
190
- Some(ref mut rx) => match Pin::new(rx).poll(cx) {
191
- Poll::Pending => Poll::Pending,
192
- Ok(Async::Ready(Ok(upgraded))) => Ok(Async::Ready(upgraded)),
193
- Ok(Async::Ready(Err(err))) => Err(err),
188
+ Some ( ref mut rx) => Pin :: new ( rx) . poll ( cx) . map ( |res| match res {
189
+ Ok ( Ok ( upgraded) ) => Ok ( upgraded) ,
190
+ Ok ( Err ( err) ) => Err ( err) ,
194
191
Err ( _oneshot_canceled) => Err (
195
192
crate :: Error :: new_canceled ( ) . with ( UpgradeExpected ( ( ) ) )
196
193
) ,
197
- },
198
- None => Err(crate::Error::new_user_no_upgrade()),
194
+ } ) ,
195
+ None => Poll :: Ready ( Err ( crate :: Error :: new_user_no_upgrade ( ) ) ) ,
199
196
}
200
- */
201
197
}
202
198
}
203
199
You can’t perform that action at this time.
0 commit comments