about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorNick Cameron <ncameron@mozilla.com>2017-03-09 14:47:29 +1300
committerNick Cameron <ncameron@mozilla.com>2017-03-09 14:47:29 +1300
commitd107ca12b83b679ed7aab54a72fcd0d01b511ed8 (patch)
treeebe3b19e419fb592b4030cc6e124e124d8aebdbb /src
parent6025492245ec0028b09477261418176a197b3ebc (diff)
Use trailing commas if block formatting fn args
Fixes #1330
Diffstat (limited to 'src')
-rw-r--r--src/items.rs10
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,