Skip to content

Commit

Permalink
please clippy
Browse files Browse the repository at this point in the history
Signed-off-by: Yoshua Wuyts <yoshuawuyts@gmail.com>
  • Loading branch information
yoshuawuyts committed Oct 29, 2019
1 parent 58e8117 commit 6b44c01
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions src/future/future/try_select.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ use std::pin::Pin;
use async_macros::MaybeDone;
use pin_project_lite::pin_project;

use std::future::Future;
use crate::task::{Context, Poll};
use std::future::Future;

pin_project! {
#[allow(missing_docs)]
Expand Down Expand Up @@ -52,12 +52,9 @@ where
// Check if the right future is ready & successful. Return err if left
// future also resolved to err. Continue if not.
let mut right = this.right;
if Future::poll(Pin::new(&mut right), cx).is_ready() {
if right.as_ref().output().unwrap().is_ok() {
return Poll::Ready(right.take().unwrap());
} else if left_errored {
return Poll::Ready(right.take().unwrap());
}
let is_ready = Future::poll(Pin::new(&mut right), cx).is_ready();
if is_ready && (right.as_ref().output().unwrap().is_ok() || left_errored) {
return Poll::Ready(right.take().unwrap());
}

Poll::Pending
Expand Down

0 comments on commit 6b44c01

Please sign in to comment.