From b8f318c303119c7048f898961f0b150e062f3a91 Mon Sep 17 00:00:00 2001 From: Caleb Cartwright Date: Thu, 28 Jan 2021 19:14:44 -0600 Subject: [PATCH] fix: don't insert trailing comma on struct lit rest in mac def --- src/expr.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/expr.rs b/src/expr.rs index 7dfa4d57b13..33add30c7c6 100644 --- a/src/expr.rs +++ b/src/expr.rs @@ -1629,7 +1629,10 @@ fn rewrite_struct_lit<'a>( nested_shape, tactic, context, - force_no_trailing_comma || has_base || !context.use_block_indent(), + force_no_trailing_comma + || has_base + || !context.use_block_indent() + || matches!(struct_rest, ast::StructRest::Rest(_)), ); write_list(&item_vec, &fmt)?