-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrustfmt.toml
More file actions
28 lines (23 loc) · 1.19 KB
/
rustfmt.toml
File metadata and controls
28 lines (23 loc) · 1.19 KB
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
# opt into nightly-only extras
unstable_features = true
# Preserve the structure of imports and avoid adding spaces in braced use statements
#imports_granularity = "Preserve"
imports_granularity = "Crate"
group_imports = "StdExternalCrate"
# Ensure no extra spaces are added inside braced use statements
normalize_doc_attributes = true
# Other formatting preferences for better readability
edition = "2024" # Use Rust 2024 edition formatting rules
max_width = 80 # Adjust line width to avoid excessive wrapping
hard_tabs = false # Use spaces instead of tabs
tab_spaces = 4 # Set indentation to 4 spaces
reorder_imports = true # Keep imports ordered
reorder_modules = true # Keep module declarations ordered
use_field_init_shorthand = true # Prefer field initialization shorthand when possible
wrap_comments = true # Auto-wrap comments that exceed max_width
format_code_in_doc_comments = true # Format Rust code inside doc comments
# Function and closure formatting
fn_single_line = true # Keep short functions in a single line
# Struct and enum formatting
struct_lit_width = 50 # Allow struct literals to be compact
enum_discrim_align_threshold = 20 # Align enum discriminants when appropriate