Skip to content

Commit

Permalink
simplify match stmt
Browse files Browse the repository at this point in the history
  • Loading branch information
lcnr committed Mar 26, 2020
1 parent a17dd36 commit c21e25c
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions src/librustc_ast_passes/ast_validation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand Down

0 comments on commit c21e25c

Please sign in to comment.