Skip to content

Commit 212a8a3

Browse files
committed
Slightly simplify write_list for DefinitiveListTactic::SpecialMacro
1 parent 0291331 commit 212a8a3

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

src/lists.rs

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ pub enum DefinitiveListTactic {
160160
Vertical,
161161
Horizontal,
162162
Mixed,
163-
// Special case tactic for `format!()`, `write!()` style macros.
163+
/// Special case tactic for `format!()`, `write!()` style macros.
164164
SpecialMacro(bool, bool, usize),
165165
}
166166

@@ -325,13 +325,10 @@ where
325325
result.push('\n');
326326
result.push_str(indent_str);
327327
}
328-
} else if i == num_args_before {
328+
} else if i <= num_args_before + 1 {
329329
result.push('\n');
330330
result.push_str(indent_str);
331-
} else if i == num_args_before + 1 {
332-
result.push('\n');
333-
result.push_str(indent_str);
334-
} else if i > num_args_before + 1 {
331+
} else {
335332
if one_line_after {
336333
result.push(' ');
337334
} else {

0 commit comments

Comments
 (0)