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.
This commit is contained in:
Trevor Gross 2024-10-26 20:18:50 -05:00
parent 84e5e10a68
commit 710ca6e38e
2 changed files with 6 additions and 1 deletions

View file

@ -41,7 +41,7 @@ jobs:
steps:
- uses: actions/checkout@master
- name: Install Rust
run: rustup update stable && rustup default stable && rustup component add rustfmt
run: rustup update nightly && rustup default nightly && rustup component add rustfmt
- run: cargo fmt -- --check
wasm:

View file

@ -0,0 +1,5 @@
# This matches rustc
style_edition = "2024"
use_small_heuristics = "Max"
group_imports = "StdExternalCrate"
imports_granularity = "Module"