Merge pull request #3306 from topecongiro/issue-2841

Do not force trailing comma when using mixed layout
This commit is contained in:
Seiichi Uchida 2019-02-01 00:23:15 +09:00 committed by GitHub
commit 7c0f59bee3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 10 additions and 3 deletions

2
Cargo.lock generated
View file

@ -1,3 +1,5 @@
# This file is automatically @generated by Cargo.
# It is not intended for manual editing.
[[package]]
name = "aho-corasick"
version = "0.6.9"

View file

@ -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()
};

View file

@ -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,
];

View file

@ -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
];