-
Notifications
You must be signed in to change notification settings - Fork 5
/
.rustfmt.toml
30 lines (30 loc) · 1008 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
# rustfmt is only used here to format imports.
#
# In my opinion, rustfmt is not good for general use, because it makes the code less readable.
#
# As an example, this:
# if is_true { return; }
# will be formatted into 3 separate lines.
#
# And this:
# struct A {
# a: u32,
# bcd: u32,
# ef: u32,
# }
# will lose carefully crafted indentation.
#
# But it is in my opinion very good idea to automatically format imports,
# because those change very frequently, and it's tedious to maintain
# alphabetic order for imports manually.
#
# If you want to only format imports, you have to enable range formatting.
# In VSCode settings:
# Rust-analyzer > Rustfmt > Range formatting: Enable
# then manually select code block, press hotkey (or right click, "Format Selection").
# As of time of this writing, it is only available on nightly rust.
#
imports_granularity = "Module"
imports_layout = "HorizontalVertical"
group_imports = "StdExternalCrate"
reorder_modules = true