Merge pull request #1520 from topecongiro/allow-match

Apply closure exception to match in args
This commit is contained in:
Nick Cameron
2017-05-09 15:21:06 +12:00
committed by GitHub
3 changed files with 18 additions and 1 deletions
+2 -1
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,
};
+8
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",
});
}
+8
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",
});
}