about summary refs log tree commit diff
path: root/compiler/rustc_parse
diff options
context:
space:
mode:
authorMatthias Krüger <matthias.krueger@famsik.de>2020-12-24 02:55:21 +0100
committerMatthias Krüger <matthias.krueger@famsik.de>2020-12-24 13:35:12 +0100
commitd12a358673b17ed74fe1a584b4cab66fe62e18d0 (patch)
tree4e2431f555f0dd3fa5df51ac629470f8112c01cd /compiler/rustc_parse
parentc34c015fe2710caf53ba7ae9d1644f9ba65a6f74 (diff)
downloadrust-d12a358673b17ed74fe1a584b4cab66fe62e18d0.tar.gz
rust-d12a358673b17ed74fe1a584b4cab66fe62e18d0.zip
use matches!() macro in more places
Diffstat (limited to 'compiler/rustc_parse')
-rw-r--r--compiler/rustc_parse/src/parser/path.rs7
1 files changed, 3 insertions, 4 deletions
diff --git a/compiler/rustc_parse/src/parser/path.rs b/compiler/rustc_parse/src/parser/path.rs
index 4510e86e034..60a47ca12b8 100644
--- a/compiler/rustc_parse/src/parser/path.rs
+++ b/compiler/rustc_parse/src/parser/path.rs
@@ -501,10 +501,9 @@ impl<'a> Parser<'a> {
     pub(super) fn expr_is_valid_const_arg(&self, expr: &P<rustc_ast::Expr>) -> bool {
         match &expr.kind {
             ast::ExprKind::Block(_, _) | ast::ExprKind::Lit(_) => true,
-            ast::ExprKind::Unary(ast::UnOp::Neg, expr) => match &expr.kind {
-                ast::ExprKind::Lit(_) => true,
-                _ => false,
-            },
+            ast::ExprKind::Unary(ast::UnOp::Neg, expr) => {
+                matches!(expr.kind, ast::ExprKind::Lit(_))
+            }
             // We can only resolve single-segment paths at the moment, because multi-segment paths
             // require type-checking: see `visit_generic_arg` in `src/librustc_resolve/late.rs`.
             ast::ExprKind::Path(None, path)