Box ExprKind::{Closure,MethodCall}, and QSelf in expressions, types, and patterns.
This commit is contained in:
@@ -36,7 +36,6 @@ pub fn expr_trailing_brace(mut expr: &ast::Expr) -> Option<&ast::Expr> {
|
||||
| Binary(_, _, e)
|
||||
| Box(e)
|
||||
| Break(_, Some(e))
|
||||
| Closure(.., e, _)
|
||||
| Let(_, e, _)
|
||||
| Range(_, Some(e), _)
|
||||
| Ret(Some(e))
|
||||
@@ -44,6 +43,9 @@ pub fn expr_trailing_brace(mut expr: &ast::Expr) -> Option<&ast::Expr> {
|
||||
| Yield(Some(e)) => {
|
||||
expr = e;
|
||||
}
|
||||
Closure(closure) => {
|
||||
expr = &closure.body;
|
||||
}
|
||||
Async(..) | Block(..) | ForLoop(..) | If(..) | Loop(..) | Match(..) | Struct(..)
|
||||
| TryBlock(..) | While(..) => break Some(expr),
|
||||
_ => break None,
|
||||
|
||||
Reference in New Issue
Block a user