From c21e25c2622c2a7294189ddc545a0cb9c621631a Mon Sep 17 00:00:00 2001 From: Bastian Kauschke Date: Thu, 26 Mar 2020 10:52:52 +0100 Subject: [PATCH] simplify match stmt --- src/librustc_ast_passes/ast_validation.rs | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/librustc_ast_passes/ast_validation.rs b/src/librustc_ast_passes/ast_validation.rs index c03c44fc634ce..d6d1153f2790f 100644 --- a/src/librustc_ast_passes/ast_validation.rs +++ b/src/librustc_ast_passes/ast_validation.rs @@ -289,11 +289,7 @@ impl<'a> AstValidator<'a> { match expr.kind { ExprKind::Lit(..) | ExprKind::Err => {} ExprKind::Path(..) if allow_paths => {} - ExprKind::Unary(UnOp::Neg, ref inner) - if match inner.kind { - ExprKind::Lit(_) => true, - _ => false, - } => {} + ExprKind::Unary(UnOp::Neg, ref inner) if matches!(inner.kind, ExprKind::Lit(_)) => {} _ => self.err_handler().span_err( expr.span, "arbitrary expressions aren't allowed \