about summary refs log tree commit diff
diff options
context:
space:
mode:
authorGuillaume Gomez <guillaume1.gomez@gmail.com>2022-05-06 20:05:45 +0200
committerGitHub <noreply@github.com>2022-05-06 20:05:45 +0200
commita411a32caea5689dc553219ec4528288edd219f2 (patch)
tree24adfd014d3281be52318c4cd1cbd69bd58eceb8
parent6db969ec95010b5e0e9164a5be6ec9d0fc54f9a1 (diff)
parentfcb385cfb116d4689ddc4ffc121d650bdc94ad91 (diff)
Rollup merge of #96776 - liuw:hir, r=oli-obk
Fix two minor issues in hir.rs

I found these two places in hir.rs which could use a bit of improvements while going through the code.

No functional change.
-rw-r--r--compiler/rustc_hir/src/hir.rs7
1 files changed, 2 insertions, 5 deletions
diff --git a/compiler/rustc_hir/src/hir.rs b/compiler/rustc_hir/src/hir.rs
index dfeee3f356f..cc6ddad2e15 100644
--- a/compiler/rustc_hir/src/hir.rs
+++ b/compiler/rustc_hir/src/hir.rs
@@ -1441,7 +1441,7 @@ pub enum AsyncGeneratorKind {
     /// An explicit `async` block written by the user.
     Block,
 
-    /// An explicit `async` block written by the user.
+    /// An explicit `async` closure written by the user.
     Closure,
 
     /// The `async` block generated as the body of an async function.
@@ -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 { .. })
     }
 }