diff options
| author | Wei Liu <liuw@liuw.name> | 2022-05-06 15:00:48 +0000 |
|---|---|---|
| committer | Wei Liu <liuw@liuw.name> | 2022-05-06 15:00:48 +0000 |
| commit | fcb385cfb116d4689ddc4ffc121d650bdc94ad91 (patch) | |
| tree | 50bce33726ef1240e1e1eba357f21945a3a7aa03 | |
| parent | 85e688e4c3c14df05b6430ae7d736ffc9180e9c7 (diff) | |
| download | rust-fcb385cfb116d4689ddc4ffc121d650bdc94ad91.tar.gz rust-fcb385cfb116d4689ddc4ffc121d650bdc94ad91.zip | |
Use matches! for YieldSource::is_await
| -rw-r--r-- | compiler/rustc_hir/src/hir.rs | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/compiler/rustc_hir/src/hir.rs b/compiler/rustc_hir/src/hir.rs index 9f3072e169c..cc6ddad2e15 100644 --- a/compiler/rustc_hir/src/hir.rs +++ b/compiler/rustc_hir/src/hir.rs @@ -2078,10 +2078,7 @@ pub enum YieldSource { impl YieldSource { pub fn is_await(&self) -> bool { - match self { - YieldSource::Await { .. } => true, - YieldSource::Yield => false, - } + matches!(self, YieldSource::Await { .. }) } } |
