Do not add block around async closure (#3946)

This commit is contained in:
Seiichi Uchida 2019-12-03 08:47:50 +09:00 committed by topecongiro
parent e47aae769e
commit 731f15551b
No known key found for this signature in database
GPG Key ID: 3C13222317860426
2 changed files with 5 additions and 0 deletions

View File

@ -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(..)

View File

@ -15,4 +15,8 @@ fn main() {
let x = 3;
x
};
let f = |x| async {
println!("hello, world");
};
}