File tree 1 file changed +4
-7
lines changed
1 file changed +4
-7
lines changed Original file line number Diff line number Diff line change @@ -3,8 +3,8 @@ use std::pin::Pin;
3
3
use async_macros:: MaybeDone ;
4
4
use pin_project_lite:: pin_project;
5
5
6
- use std:: future:: Future ;
7
6
use crate :: task:: { Context , Poll } ;
7
+ use std:: future:: Future ;
8
8
9
9
pin_project ! {
10
10
#[ allow( missing_docs) ]
52
52
// Check if the right future is ready & successful. Return err if left
53
53
// future also resolved to err. Continue if not.
54
54
let mut right = this. right ;
55
- if Future :: poll ( Pin :: new ( & mut right) , cx) . is_ready ( ) {
56
- if right. as_ref ( ) . output ( ) . unwrap ( ) . is_ok ( ) {
57
- return Poll :: Ready ( right. take ( ) . unwrap ( ) ) ;
58
- } else if left_errored {
59
- return Poll :: Ready ( right. take ( ) . unwrap ( ) ) ;
60
- }
55
+ let is_ready = Future :: poll ( Pin :: new ( & mut right) , cx) . is_ready ( ) ;
56
+ if is_ready && ( right. as_ref ( ) . output ( ) . unwrap ( ) . is_ok ( ) || left_errored) {
57
+ return Poll :: Ready ( right. take ( ) . unwrap ( ) ) ;
61
58
}
62
59
63
60
Poll :: Pending
You can’t perform that action at this time.
0 commit comments