Apply closure exception to match in args

This commit is contained in:
topecongiro 2017-05-09 08:28:05 +09:00
parent 35150ed7ad
commit 0248e9869d
3 changed files with 18 additions and 1 deletions

View File

@ -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,
};

View File

@ -380,3 +380,11 @@ fn issue1460() {
_ => "reorder_something",
};
}
fn issue525() {
foobar(f, "{}", match *self {
TaskState::Started => "started",
TaskState::Success => "success",
TaskState::Failed => "failed",
});
}

View File

@ -398,3 +398,11 @@ fn issue1460() {
_ => "reorder_something",
};
}
fn issue525() {
foobar(f, "{}", match *self {
TaskState::Started => "started",
TaskState::Success => "success",
TaskState::Failed => "failed",
});
}