diff options
| author | Mazdak Farrokhzad <twingoow@gmail.com> | 2020-01-09 00:22:10 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-01-09 00:22:10 +0100 |
| commit | 5ea69781f46a556b3d6f7e8e52d5641d61d12131 (patch) | |
| tree | a5024d981e459032f7ca7c9c59485fd783ef0405 /src/libcore/task | |
| parent | 11f0013378f8a7ec7a2ca3e09afd78e1397273e7 (diff) | |
| parent | f720469fd0c4dff6d92e2f778ea2f252f76dcc2e (diff) | |
| download | rust-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.rs | 5 |
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` |
