Skip to content

Commit 9b8e48a

Browse files
committed
Add a rustfmt.toml file matching rust-lang/rust
Duplicate the settings from rust-lang/rust to this repository. This is mostly for consistency, but `use_small_heuristics = "Max"` does make a large difference with lookup tables. Also apply the needed CI changes to run nightly rustfmt.
1 parent f4e5b38 commit 9b8e48a

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

.github/workflows/main.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ jobs:
4141
steps:
4242
- uses: actions/checkout@master
4343
- name: Install Rust
44-
run: rustup update stable && rustup default stable && rustup component add rustfmt
44+
run: rustup update nightly && rustup default nightly && rustup component add rustfmt
4545
- run: cargo fmt -- --check
4646

4747
wasm:

.rustfmt.toml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# This matches rustc
2+
style_edition = "2024"
3+
use_small_heuristics = "Max"
4+
group_imports = "StdExternalCrate"
5+
imports_granularity = "Module"

0 commit comments

Comments
 (0)