Skip to content

Commit 13d4db7

Browse files
authored
Add opinionated rustfmt.toml (#5)
1 parent 229307d commit 13d4db7

1 file changed

Lines changed: 26 additions & 0 deletions

File tree

rustfmt.toml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
##############################################################################
2+
# Rustfmt configuration – project-wide style guide
3+
#
4+
# Docs: https://rust-lang.github.io/rustfmt
5+
##############################################################################
6+
7+
# --- Imports ----------------------------------------------------------------
8+
reorder_imports = true # Alphabetise & group `use` items.
9+
imports_granularity = "Crate" # Merge paths that share the same crate
10+
# → e.g. `use std::{fmt, io};`
11+
condense_wildcard_suffixes = true # Prefer `use foo::{self, Bar};`
12+
# over two separate lines.
13+
14+
# --- Readability ------------------------------------------------------------
15+
max_width = 100 # Hard column limit for all code
16+
wrap_comments = true # Break comments to fit on the line
17+
format_code_in_doc_comments= true # Rust-format code blocks in docs
18+
use_field_init_shorthand = true # `{ x, y }` instead of `{ x: x, y: y }`
19+
trailing_comma = "Vertical" # Comma-terminate every multi-line list
20+
21+
# ---------- Implementation order -------------------------------------------
22+
reorder_impl_items = true # Deterministic ordering inside impl blocks
23+
24+
# --- Misc -------------------------------------------------------------------
25+
edition = "2024" # Controls the edition of the Rust Style Guide
26+
# to use for formatting (RFC 3338)

0 commit comments

Comments
 (0)