Use matches macro in libcore and libstd

This commit is contained in:
Igor Aleksanov 2020-01-07 10:35:16 +03:00
parent aa0769b92e
commit f720469fd0
12 changed files with 29 additions and 118 deletions

View file

@ -39,10 +39,7 @@ impl<T> Poll<T> {
#[inline]
#[stable(feature = "futures_api", since = "1.36.0")]
pub fn is_ready(&self) -> bool {
match *self {
Poll::Ready(_) => true,
Poll::Pending => false,
}
matches!(*self, Poll::Ready(_))
}
/// Returns `true` if this is `Poll::Pending`