Skip to content

Commit

Permalink
refactor: Simplify unify
Browse files Browse the repository at this point in the history
  • Loading branch information
Markus Westerlind committed Oct 14, 2020
1 parent d2e1911 commit 831f312
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions src/filter/unify.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,8 @@ where

#[inline]
fn poll(self: Pin<&mut Self>, cx: &mut Context) -> Poll<Self::Output> {
let unified = match ready!(self.project().inner.try_poll(cx)) {
Ok((Either::A(a),)) => Ok(a),
Ok((Either::B(b),)) => Ok(b),
Err(err) => Err(err),
};
Poll::Ready(unified)
Poll::Ready(match ready!(self.project().inner.try_poll(cx))? {
(Either::A(x),) | (Either::B(x),) => Ok(x),
})
}
}

0 comments on commit 831f312

Please sign in to comment.