-
Notifications
You must be signed in to change notification settings - Fork 5
/
rustfmt.toml
196 lines (196 loc) · 4.22 KB
/
rustfmt.toml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
# Convert /* */ comments to // comments where possible
#
# Default value: false
# Possible values: true, false
# Stable: No (tracking issue: #3350)
# false (default):
# // Lorem ipsum:
# fn dolor() -> usize {}
#
# /* sit amet: */
# fn adipiscing() -> usize {}
# true:
# // Lorem ipsum:
# fn dolor() -> usize {}
#
# // sit amet:
# fn adipiscing() -> usize {}
normalize_comments = true
# Reorder impl items. type and const are put first, then macros and methods.
#
# Default value: false
# Possible values: true, false
# Stable: No (tracking issue: #3363)
# false (default)
# struct Dummy;
#
# impl Iterator for Dummy {
# fn next(&mut self) -> Option<Self::Item> {
# None
# }
#
# type Item = i32;
# }
# true
# struct Dummy;
#
# impl Iterator for Dummy {
# type Item = i32;
#
# fn next(&mut self) -> Option<Self::Item> {
# None
# }
# }
reorder_impl_items = true
# The maximum diff of width between struct fields to be aligned with each other.
#
# Default value : 0
# Possible values: any non-negative integer
# Stable: No (tracking issue: #3371)
# 0 (default):
# struct Foo {
# x: u32,
# yy: u32,
# zzz: u32,
# }
# 20:
# struct Foo {
# x: u32,
# yy: u32,
# zzz: u32,
# }
struct_field_align_threshold = 25
# Use field initialize shorthand if possible.
#
# Default value: false
# Possible values: true, false
# Stable: Yes
# false (default):
# struct Foo {
# x: u32,
# y: u32,
# z: u32,
# }
#
# fn main() {
# let x = 1;
# let y = 2;
# let z = 3;
# let a = Foo { x: x, y: y, z: z };
# }
# true:
# struct Foo {
# x: u32,
# y: u32,
# z: u32,
# }
#
# fn main() {
# let x = 1;
# let y = 2;
# let z = 3;
# let a = Foo { x, y, z };
# }
use_field_init_shorthand = true
# Replace uses of the try! macro by the ? shorthand
#
# Default value: false
# Possible values: true, false
# Stable: Yes
# false (default):
# fn main() {
# let lorem = try!(ipsum.map(|dolor| dolor.sit()));
# }
# true:
# fn main() {
# let lorem = ipsum.map(|dolor| dolor.sit())?;
# }
use_try_shorthand = true
# Break comments to fit on the line
#
# Default value: false
# Possible values: true, false
# Stable: No (tracking issue: #3347)
# false (default):
# // Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
# true:
# // Lorem ipsum dolor sit amet, consectetur adipiscing elit,
# // sed do eiusmod tempor incididunt ut labore et dolore
# // magna aliqua. Ut enim ad minim veniam, quis nostrud
# // exercitation ullamco laboris nisi ut aliquip ex ea
# // commodo consequat.
wrap_comments = true
# When structs, slices, arrays, and block/array-like macros are used as the last argument in an expression list, allow them to overflow (like blocks/closures) instead of being indented on a new line.
#
# Default value: false
# Possible values: true, false
# Stable: No (tracking issue: #3370)
# false (default):
# fn example() {
# foo(ctx, |param| {
# action();
# foo(param)
# });
#
# foo(
# ctx,
# Bar {
# x: value,
# y: value2,
# },
# );
#
# foo(
# ctx,
# &[
# MAROON_TOMATOES,
# PURPLE_POTATOES,
# ORGANE_ORANGES,
# GREEN_PEARS,
# RED_APPLES,
# ],
# );
#
# foo(
# ctx,
# vec![
# MAROON_TOMATOES,
# PURPLE_POTATOES,
# ORGANE_ORANGES,
# GREEN_PEARS,
# RED_APPLES,
# ],
# );
# }
# true:
# fn example() {
# foo(ctx, |param| {
# action();
# foo(param)
# });
#
# foo(ctx, Bar {
# x: value,
# y: value2,
# });
#
# foo(ctx, &[
# MAROON_TOMATOES,
# PURPLE_POTATOES,
# ORGANE_ORANGES,
# GREEN_PEARS,
# RED_APPLES,
# ]);
#
# foo(ctx, vec![
# MAROON_TOMATOES,
# PURPLE_POTATOES,
# ORGANE_ORANGES,
# GREEN_PEARS,
# RED_APPLES,
# ]);
# }
overflow_delimited_expr = true
imports_granularity = "Crate"
reorder_imports = true
group_imports = "StdExternalCrate"