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:
parent
e44a7a2800
commit
b3f41e82fc
3 changed files with 15 additions and 3 deletions
|
@ -1335,9 +1335,10 @@ fn rewrite_struct_lit<'a>(context: &RewriteContext,
|
||||||
},
|
},
|
||||||
indent: indent,
|
indent: indent,
|
||||||
width: budget,
|
width: budget,
|
||||||
ends_with_newline: match context.config.struct_lit_style {
|
ends_with_newline: match tactic {
|
||||||
StructLitStyle::Block => true,
|
DefinitiveListTactic::Horizontal => false,
|
||||||
StructLitStyle::Visual => false,
|
DefinitiveListTactic::Vertical => true,
|
||||||
|
DefinitiveListTactic::Mixed => unreachable!(),
|
||||||
},
|
},
|
||||||
config: context.config,
|
config: context.config,
|
||||||
};
|
};
|
||||||
|
|
|
@ -110,4 +110,7 @@ fn issue491() {
|
||||||
Foo {
|
Foo {
|
||||||
arm: 0, // Comment
|
arm: 0, // Comment
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Foo { a: aaaaaaaaaa, b: bbbbbbbb, c: cccccccccc, d: dddddddddd, /* a comment */
|
||||||
|
e: eeeeeeeee };
|
||||||
}
|
}
|
||||||
|
|
|
@ -140,4 +140,12 @@ fn issue491() {
|
||||||
};
|
};
|
||||||
|
|
||||||
Foo { arm: 0 /* Comment */ };
|
Foo { arm: 0 /* Comment */ };
|
||||||
|
|
||||||
|
Foo {
|
||||||
|
a: aaaaaaaaaa,
|
||||||
|
b: bbbbbbbb,
|
||||||
|
c: cccccccccc,
|
||||||
|
d: dddddddddd, // a comment
|
||||||
|
e: eeeeeeeee,
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue