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
# Rust Formatting Configuration
# https://rust-lang.github.io/rustfmt/
#
# Run: cargo fmt
# Check only: cargo fmt -- --check
# =============================================================================
# STABLE OPTIONS (work with stable Rust)
# =============================================================================
# Edition (should match Cargo.toml)
= "2021"
# Line width - 100 is standard, balances readability with screen space
= 100
# Indentation
= 4
= false
# Imports
= true
= true
# Braces
= "SameLineWhere"
# Match expressions
= true
= true
# Struct literals
= true
= true
# Shorthand syntax (enabled by default, explicit for clarity)
= true
= true
# Line endings - Auto detects from existing files
= "Auto"
# =============================================================================
# UNSTABLE OPTIONS (require nightly: rustup run nightly cargo fmt)
# Uncomment these if using nightly rustfmt
# =============================================================================
# # Import grouping and granularity
# imports_granularity = "Module"
# group_imports = "StdExternalCrate"
# # Doc comment formatting (important for crates with examples)
# format_code_in_doc_comments = true
# # Function signatures
# fn_params_layout = "Tall"
# fn_single_line = false
# # Comment handling
# wrap_comments = false
# normalize_comments = false
# # Macro formatting
# format_macro_matchers = true
# format_macro_bodies = true