Rearrange logic of needs_par computation in print_let

True || needs_par_as_let_scrutinee(...) is always true.
This commit is contained in:
David Tolnay
2023-11-29 21:28:22 -08:00
parent 8d64961589
commit dc5ec724c0

View File

@@ -1166,8 +1166,11 @@ impl<'a> State<'a> {
| ast::ExprKind::Closure(..) | ast::ExprKind::Closure(..)
| ast::ExprKind::Ret(..) | ast::ExprKind::Ret(..)
| ast::ExprKind::Yeet(..) => true, | ast::ExprKind::Yeet(..) => true,
_ => parser::contains_exterior_struct_lit(expr), _ => {
} || parser::needs_par_as_let_scrutinee(expr.precedence().order()), parser::contains_exterior_struct_lit(expr)
|| parser::needs_par_as_let_scrutinee(expr.precedence().order())
}
},
); );
} }