Merge pull request #1520 from topecongiro/allow-match
Apply closure exception to match in args
This commit is contained in:
commit
da261ef9d3
3 changed files with 18 additions and 1 deletions
|
@ -1696,7 +1696,8 @@ fn rewrite_call_inner<R>(context: &RewriteContext,
|
|||
// we format the function arguments horizontally.
|
||||
let overflow_last = match args.last().map(|x| &x.node) {
|
||||
Some(&ast::ExprKind::Closure(..)) |
|
||||
Some(&ast::ExprKind::Block(..)) if arg_count > 1 => true,
|
||||
Some(&ast::ExprKind::Block(..)) |
|
||||
Some(&ast::ExprKind::Match(..)) if arg_count > 1 => true,
|
||||
_ => false,
|
||||
};
|
||||
|
||||
|
|
|
@ -380,3 +380,11 @@ fn issue1460() {
|
|||
_ => "reorder_something",
|
||||
};
|
||||
}
|
||||
|
||||
fn issue525() {
|
||||
foobar(f, "{}", match *self {
|
||||
TaskState::Started => "started",
|
||||
TaskState::Success => "success",
|
||||
TaskState::Failed => "failed",
|
||||
});
|
||||
}
|
||||
|
|
|
@ -398,3 +398,11 @@ fn issue1460() {
|
|||
_ => "reorder_something",
|
||||
};
|
||||
}
|
||||
|
||||
fn issue525() {
|
||||
foobar(f, "{}", match *self {
|
||||
TaskState::Started => "started",
|
||||
TaskState::Success => "success",
|
||||
TaskState::Failed => "failed",
|
||||
});
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue