about summary refs log tree commit diff
path: root/src/libcore/task
diff options
context:
space:
mode:
authorMazdak Farrokhzad <twingoow@gmail.com>2020-01-09 00:22:10 +0100
committerGitHub <noreply@github.com>2020-01-09 00:22:10 +0100
commit5ea69781f46a556b3d6f7e8e52d5641d61d12131 (patch)
treea5024d981e459032f7ca7c9c59485fd783ef0405 /src/libcore/task
parent11f0013378f8a7ec7a2ca3e09afd78e1397273e7 (diff)
parentf720469fd0c4dff6d92e2f778ea2f252f76dcc2e (diff)
downloadrust-5ea69781f46a556b3d6f7e8e52d5641d61d12131.tar.gz
rust-5ea69781f46a556b3d6f7e8e52d5641d61d12131.zip
Rollup merge of #67966 - popzxc:core-std-matches, r=Centril
Use matches macro in libcore and libstd

This PR replaces matches like

```rust
match var {
    value => true,
    _ => false,
}
```

with use of `matches!` macro.

r? @Centril
Diffstat (limited to 'src/libcore/task')
-rw-r--r--src/libcore/task/poll.rs5
1 files changed, 1 insertions, 4 deletions
diff --git a/src/libcore/task/poll.rs b/src/libcore/task/poll.rs
index d567ae54577..b3a4bd20b8f 100644
--- a/src/libcore/task/poll.rs
+++ b/src/libcore/task/poll.rs
@@ -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`