-
Notifications
You must be signed in to change notification settings - Fork 19
/
rustfmt.toml
32 lines (26 loc) · 967 Bytes
/
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
# Daniel's opinionated rustfmt settings.
# I was somewhat reluctant to use rustfmt at first as I am fairly opinionated about certain code formatting choices
# and early tests on MartyPC mangled some very long match arms, especially in the instruction decoder. But I'm biting
# the bullet and implementing it.
max_width = 120
# Keep 'if' and 'else' in the same column.
# if lorem {
# println!("ipsum!");
# }
# else {
# println!("dolor!");
# }
control_brace_style = "ClosingNextLine"
# I like to keep enum struct variants on one line if possible. The default of 35 is a bit too short and would
# split this example into individual lines:
#
# pub enum ScalerOption {
# Mode(ScalerMode),
# Adjustment { h: f32, s: f32, b: f32, c: f32, g: f32 },
struct_variant_width = 65
# Preferred input formats.
imports_granularity = "Crate"
imports_layout = "HorizontalVertical"
# I like aligning things
enum_discrim_align_threshold = 3
struct_field_align_threshold = 3