From 0c8640a84f0cf4ce01665aa482f4470edcf12410 Mon Sep 17 00:00:00 2001 From: Ari Koivula Date: Sun, 13 Mar 2016 23:27:13 +0200 Subject: [PATCH] Fix last comment turning into block comment This fixes the comment after the last argument in an argument list being turned into a block comment when it's not necessary. --- src/items.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/items.rs b/src/items.rs index 9e5b964429e7..f0a7d94ebe78 100644 --- a/src/items.rs +++ b/src/items.rs @@ -1370,13 +1370,18 @@ fn rewrite_args(context: &RewriteContext, _ => multi_line_budget, }; + let end_with_newline = match context.config.fn_args_layout { + StructLitStyle::Block => true, + _ => false, + }; + let fmt = ListFormatting { tactic: tactic, separator: ",", trailing_separator: SeparatorTactic::Never, indent: indent, width: budget, - ends_with_newline: false, + ends_with_newline: end_with_newline, config: context.config, };