Do not add block around async closure (#3946)
This commit is contained in:
parent
e47aae769e
commit
731f15551b
@ -170,6 +170,7 @@ fn rewrite_closure_expr(
|
||||
fn allow_multi_line(expr: &ast::Expr) -> bool {
|
||||
match expr.kind {
|
||||
ast::ExprKind::Match(..)
|
||||
| ast::ExprKind::Async(..)
|
||||
| ast::ExprKind::Block(..)
|
||||
| ast::ExprKind::TryBlock(..)
|
||||
| ast::ExprKind::Loop(..)
|
||||
|
@ -15,4 +15,8 @@ fn main() {
|
||||
let x = 3;
|
||||
x
|
||||
};
|
||||
|
||||
let f = |x| async {
|
||||
println!("hello, world");
|
||||
};
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user