Skip to content

Commit 55df8a1

Browse files
committed
please clippy
Signed-off-by: Yoshua Wuyts <[email protected]>
1 parent f29fe54 commit 55df8a1

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

src/future/future/try_select.rs

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ use std::pin::Pin;
33
use async_macros::MaybeDone;
44
use pin_project_lite::pin_project;
55

6-
use std::future::Future;
76
use crate::task::{Context, Poll};
7+
use std::future::Future;
88

99
pin_project! {
1010
#[allow(missing_docs)]
@@ -52,12 +52,9 @@ where
5252
// Check if the right future is ready & successful. Return err if left
5353
// future also resolved to err. Continue if not.
5454
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());
6158
}
6259

6360
Poll::Pending

0 commit comments

Comments
 (0)