diff options
| author | Nick Cameron <ncameron@mozilla.com> | 2017-03-09 14:47:29 +1300 |
|---|---|---|
| committer | Nick Cameron <ncameron@mozilla.com> | 2017-03-09 14:47:29 +1300 |
| commit | d107ca12b83b679ed7aab54a72fcd0d01b511ed8 (patch) | |
| tree | ebe3b19e419fb592b4030cc6e124e124d8aebdbb /src | |
| parent | 6025492245ec0028b09477261418176a197b3ebc (diff) | |
Use trailing commas if block formatting fn args
Fixes #1330
Diffstat (limited to 'src')
| -rw-r--r-- | src/items.rs | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/items.rs b/src/items.rs index ea8ac6687a6..8f35d58e919 100644 --- a/src/items.rs +++ b/src/items.rs @@ -1776,16 +1776,16 @@ fn rewrite_args(context: &RewriteContext, debug!("rewrite_args: budget: {}, tactic: {:?}", budget, tactic); - let end_with_newline = match context.config.fn_args_layout { - FnArgLayoutStyle::Block | - FnArgLayoutStyle::BlockAlways => true, - _ => false, + let (trailing_comma, end_with_newline) = match context.config.fn_args_layout { + FnArgLayoutStyle::Block => (SeparatorTactic::Vertical, true), + FnArgLayoutStyle::BlockAlways => (SeparatorTactic::Always, true), + _ => (SeparatorTactic::Never, false), }; let fmt = ListFormatting { tactic: tactic, separator: ",", - trailing_separator: SeparatorTactic::Never, + trailing_separator: trailing_comma, shape: Shape::legacy(budget, indent), ends_with_newline: end_with_newline, config: context.config, |
