Skip to content

Commit

Permalink
Do not force trailing comma when using mixed layout
Browse files Browse the repository at this point in the history
  • Loading branch information
topecongiro committed Jan 31, 2019
1 parent 923da60 commit 154ccf6
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 3 deletions.
2 changes: 2 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 0 additions & 3 deletions src/overflow.rs
Original file line number Diff line number Diff line change
Expand Up @@ -607,9 +607,6 @@ impl<'a> Context<'a> {
tactic
} else if !self.context.use_block_indent() {
SeparatorTactic::Never
} else if tactic == DefinitiveListTactic::Mixed {
// We are using mixed layout because everything did not fit within a single line.
SeparatorTactic::Always
} else {
self.context.config.trailing_comma()
};
Expand Down
4 changes: 4 additions & 0 deletions tests/source/trailing-comma-never.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,7 @@ enum StructY {
i: i32,
}
}

static XXX: [i8; 64] = [
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,1, 1, 1,
];
4 changes: 4 additions & 0 deletions tests/target/trailing-comma-never.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,7 @@ enum StructY {
A { s: u16 },
B { u: u32, i: i32 }
}

static XXX: [i8; 64] = [
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1
];

0 comments on commit 154ccf6

Please sign in to comment.