Skip to content

Commit c21e25c

Browse files
committed
simplify match stmt
1 parent a17dd36 commit c21e25c

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

src/librustc_ast_passes/ast_validation.rs

+1-5
Original file line numberDiff line numberDiff line change
@@ -289,11 +289,7 @@ impl<'a> AstValidator<'a> {
289289
match expr.kind {
290290
ExprKind::Lit(..) | ExprKind::Err => {}
291291
ExprKind::Path(..) if allow_paths => {}
292-
ExprKind::Unary(UnOp::Neg, ref inner)
293-
if match inner.kind {
294-
ExprKind::Lit(_) => true,
295-
_ => false,
296-
} => {}
292+
ExprKind::Unary(UnOp::Neg, ref inner) if matches!(inner.kind, ExprKind::Lit(_)) => {}
297293
_ => self.err_handler().span_err(
298294
expr.span,
299295
"arbitrary expressions aren't allowed \

0 commit comments

Comments
 (0)