simplify match stmt

This commit is contained in:
Bastian Kauschke 2020-03-26 10:52:52 +01:00
parent a17dd36084
commit c21e25c262

View File

@ -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 \