Use tactic instead of config

Add mixed test
Mixed is unreachable as there is no input combination that could get
to this value
This commit is contained in:
David Barnett 2015-11-20 10:37:00 +13:00
parent e44a7a2800
commit b3f41e82fc
3 changed files with 15 additions and 3 deletions

View file

@ -1335,9 +1335,10 @@ fn rewrite_struct_lit<'a>(context: &RewriteContext,
},
indent: indent,
width: budget,
ends_with_newline: match context.config.struct_lit_style {
StructLitStyle::Block => true,
StructLitStyle::Visual => false,
ends_with_newline: match tactic {
DefinitiveListTactic::Horizontal => false,
DefinitiveListTactic::Vertical => true,
DefinitiveListTactic::Mixed => unreachable!(),
},
config: context.config,
};

View file

@ -110,4 +110,7 @@ fn issue491() {
Foo {
arm: 0, // Comment
};
Foo { a: aaaaaaaaaa, b: bbbbbbbb, c: cccccccccc, d: dddddddddd, /* a comment */
e: eeeeeeeee };
}

View file

@ -140,4 +140,12 @@ fn issue491() {
};
Foo { arm: 0 /* Comment */ };
Foo {
a: aaaaaaaaaa,
b: bbbbbbbb,
c: cccccccccc,
d: dddddddddd, // a comment
e: eeeeeeeee,
};
}