Merge pull request #618 from zyphrus/master
Comments in structs use appropriate style
This commit is contained in:
commit
3533f72c45
@ -1373,7 +1373,11 @@ fn rewrite_struct_lit<'a>(context: &RewriteContext,
|
||||
},
|
||||
indent: indent,
|
||||
width: budget,
|
||||
ends_with_newline: false,
|
||||
ends_with_newline: match tactic {
|
||||
DefinitiveListTactic::Horizontal => false,
|
||||
DefinitiveListTactic::Vertical => true,
|
||||
DefinitiveListTactic::Mixed => unreachable!(),
|
||||
},
|
||||
config: context.config,
|
||||
};
|
||||
let fields_str = try_opt!(write_list(&item_vec, &fmt));
|
||||
|
@ -100,3 +100,17 @@ fn issue123() {
|
||||
|
||||
Foo { a: ddddddddddddddddddddd, b: cccccccccccccccccccccccccccccccccccccc };
|
||||
}
|
||||
|
||||
fn issue491() {
|
||||
Foo {
|
||||
guard: None,
|
||||
arm: 0, // Comment
|
||||
};
|
||||
|
||||
Foo {
|
||||
arm: 0, // Comment
|
||||
};
|
||||
|
||||
Foo { a: aaaaaaaaaa, b: bbbbbbbb, c: cccccccccc, d: dddddddddd, /* a comment */
|
||||
e: eeeeeeeee };
|
||||
}
|
||||
|
@ -71,3 +71,10 @@ fn issue201() {
|
||||
fn issue201_2() {
|
||||
let s = S{a: S2{ .. c}, .. b};
|
||||
}
|
||||
|
||||
fn issue491() {
|
||||
Foo {
|
||||
guard: None,
|
||||
arm: 0, // Comment
|
||||
};
|
||||
}
|
||||
|
@ -25,7 +25,7 @@ fn main() {
|
||||
// Comment
|
||||
a: foo(), // Comment
|
||||
// Comment
|
||||
b: bar(), /* Comment */
|
||||
b: bar(), // Comment
|
||||
};
|
||||
|
||||
Foo { a: Bar, b: f() };
|
||||
@ -132,3 +132,20 @@ fn issue123() {
|
||||
b: cccccccccccccccccccccccccccccccccccccc,
|
||||
};
|
||||
}
|
||||
|
||||
fn issue491() {
|
||||
Foo {
|
||||
guard: None,
|
||||
arm: 0, // Comment
|
||||
};
|
||||
|
||||
Foo { arm: 0 /* Comment */ };
|
||||
|
||||
Foo {
|
||||
a: aaaaaaaaaa,
|
||||
b: bbbbbbbb,
|
||||
c: cccccccccc,
|
||||
d: dddddddddd, // a comment
|
||||
e: eeeeeeeee,
|
||||
};
|
||||
}
|
||||
|
@ -32,7 +32,7 @@ fn main() {
|
||||
// Comment
|
||||
a: foo(), // Comment
|
||||
// Comment
|
||||
b: bar(), /* Comment */
|
||||
b: bar(), // Comment
|
||||
};
|
||||
|
||||
Foo {
|
||||
@ -107,3 +107,10 @@ fn issue201_2() {
|
||||
..b
|
||||
};
|
||||
}
|
||||
|
||||
fn issue491() {
|
||||
Foo {
|
||||
guard: None,
|
||||
arm: 0, // Comment
|
||||
};
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user