File tree 8 files changed +36
-22
lines changed
8 files changed +36
-22
lines changed Original file line number Diff line number Diff line change @@ -236,7 +236,7 @@ fn main() {
236
236
``` rust
237
237
fn main () {
238
238
let lorem = Lorem { ipsum : dolor ,
239
- sit : amet , };
239
+ sit : amet };
240
240
}
241
241
```
242
242
Original file line number Diff line number Diff line change @@ -1610,7 +1610,7 @@ fn rewrite_struct_lit<'a>(
1610
1610
nested_shape,
1611
1611
tactic,
1612
1612
context,
1613
- force_no_trailing_comma || base. is_some ( ) ,
1613
+ force_no_trailing_comma || base. is_some ( ) || !context . use_block_indent ( ) ,
1614
1614
) ;
1615
1615
1616
1616
write_list ( & item_vec, & fmt) ?
Original file line number Diff line number Diff line change
1
+ // rustfmt-indent_style: Visual
2
+ fn main ( ) {
3
+ Struct { field : aaaaaaaaaaa } ;
4
+ Struct { field : aaaaaaaaaaaa, } ;
5
+ Struct { field : value,
6
+ field2 : value2, } ;
7
+ }
Original file line number Diff line number Diff line change @@ -55,11 +55,11 @@ fn main() {
55
55
56
56
fn floaters ( ) {
57
57
let z = Foo { field1 : val1,
58
- field2 : val2, } ;
58
+ field2 : val2 } ;
59
59
60
60
let x = Foo { field1 : val1,
61
- field2 : val2, } . method_call ( )
62
- . method_call ( ) ;
61
+ field2 : val2 } . method_call ( )
62
+ . method_call ( ) ;
63
63
64
64
let y = if cond { val1 } else { val2 } . method_call ( ) ;
65
65
@@ -89,11 +89,11 @@ fn floaters() {
89
89
. quux ( ) ;
90
90
91
91
Foo { y : i_am_multi_line,
92
- z : ok, } . baz ( || {
93
- force ( ) ;
94
- multiline ( ) ;
95
- } )
96
- . quux ( ) ;
92
+ z : ok } . baz ( || {
93
+ force ( ) ;
94
+ multiline ( ) ;
95
+ } )
96
+ . quux ( ) ;
97
97
98
98
a + match x {
99
99
true => "yay!" ,
Original file line number Diff line number Diff line change 3
3
4
4
fn main ( ) {
5
5
let lorem = Lorem { ipsum : dolor,
6
- sit : amet, } ;
6
+ sit : amet } ;
7
7
}
Original file line number Diff line number Diff line change
1
+ // rustfmt-indent_style: Visual
2
+ fn main ( ) {
3
+ Struct { field : aaaaaaaaaaa } ;
4
+ Struct { field : aaaaaaaaaaaa } ;
5
+ Struct { field : value,
6
+ field2 : value2 } ;
7
+ }
Original file line number Diff line number Diff line change @@ -20,30 +20,30 @@ fn main() {
20
20
Foooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo { // Comment
21
21
a : foo ( ) , /* Comment */
22
22
// Comment
23
- b : bar ( ) , /* Comment */ } ;
23
+ b : bar ( ) /* Comment */ } ;
24
24
25
25
Foo { a : Bar , b : f ( ) } ;
26
26
27
27
Quux { x : if cond {
28
28
bar ( ) ;
29
29
} ,
30
- y : baz ( ) , } ;
30
+ y : baz ( ) } ;
31
31
32
32
Baz { x : yxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx,
33
- z : zzzzz, /* test */ } ;
33
+ z : zzzzz /* test */ } ;
34
34
35
35
A { // Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec a diam lectus. Sed sit
36
36
// amet ipsum mauris. Maecenas congue ligula ac quam viverra nec consectetur ante
37
37
// hendrerit. Donec et mollis dolor.
38
38
first : item ( ) ,
39
39
// Praesent et diam eget libero egestas mattis sit amet vitae augue.
40
40
// Nam tincidunt congue enim, ut porta lorem lacinia consectetur.
41
- second : Item , } ;
41
+ second : Item } ;
42
42
43
43
Diagram { // o This graph demonstrates how
44
44
// / \ significant whitespace is
45
45
// o o preserved.
46
46
// /|\ \
47
47
// o o o o
48
- graph : G , }
48
+ graph : G }
49
49
}
Original file line number Diff line number Diff line change @@ -17,33 +17,33 @@ fn main() {
17
17
..something } ;
18
18
19
19
Fooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo { a : foo ( ) ,
20
- b : bar ( ) , } ;
20
+ b : bar ( ) } ;
21
21
22
22
Foooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo { // Comment
23
23
a : foo ( ) , /* Comment */
24
24
// Comment
25
- b : bar ( ) , /* Comment */ } ;
25
+ b : bar ( ) /* Comment */ } ;
26
26
27
27
Foo { a : Bar ,
28
- b : foo ( ) , } ;
28
+ b : foo ( ) } ;
29
29
30
30
Quux { x : if cond {
31
31
bar ( ) ;
32
32
} ,
33
- y : baz ( ) , } ;
33
+ y : baz ( ) } ;
34
34
35
35
A { // Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec a diam lectus. Sed sit
36
36
// amet ipsum mauris. Maecenas congue ligula ac quam viverra nec consectetur ante
37
37
// hendrerit. Donec et mollis dolor.
38
38
first : item ( ) ,
39
39
// Praesent et diam eget libero egestas mattis sit amet vitae augue.
40
40
// Nam tincidunt congue enim, ut porta lorem lacinia consectetur.
41
- second : Item , } ;
41
+ second : Item } ;
42
42
43
43
Diagram { // o This graph demonstrates how
44
44
// / \ significant whitespace is
45
45
// o o preserved.
46
46
// /|\ \
47
47
// o o o o
48
- graph : G , }
48
+ graph : G }
49
49
}
You can’t perform that action at this time.
0 commit comments