Merge pull request #3462 from stjepang/fix-async-formatting
Fix formatting of async blocks
This commit is contained in:
commit
0732cd69b9
@ -1357,7 +1357,7 @@ pub fn can_be_overflowed_expr(
|
||||
}
|
||||
|
||||
// Handle always block-like expressions
|
||||
ast::ExprKind::Block(..) | ast::ExprKind::Closure(..) => true,
|
||||
ast::ExprKind::Async(..) | ast::ExprKind::Block(..) | ast::ExprKind::Closure(..) => true,
|
||||
|
||||
// Handle `[]` and `{}`-like expressions
|
||||
ast::ExprKind::Array(..) | ast::ExprKind::Struct(..) => {
|
||||
|
@ -16,4 +16,20 @@ fn baz() {
|
||||
let y = async {
|
||||
Ok(())
|
||||
}; // comment
|
||||
|
||||
spawn(
|
||||
a,
|
||||
async move {
|
||||
action();
|
||||
Ok(())
|
||||
},
|
||||
);
|
||||
|
||||
spawn(
|
||||
a,
|
||||
async move || {
|
||||
action();
|
||||
Ok(())
|
||||
},
|
||||
);
|
||||
}
|
||||
|
@ -12,4 +12,14 @@ fn baz() {
|
||||
};
|
||||
|
||||
let y = async { Ok(()) }; // comment
|
||||
|
||||
spawn(a, async move {
|
||||
action();
|
||||
Ok(())
|
||||
});
|
||||
|
||||
spawn(a, async move || {
|
||||
action();
|
||||
Ok(())
|
||||
});
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user