Skip to content

Commit

Permalink
Add edition to .rustfmt.toml
Browse files Browse the repository at this point in the history
When invoked standalone (i.e. not through `cargo fmt`), `rustfmt` does not respect the edition (or any other configuration) in `Cargo.toml`, instead relying solely on `rustfmt.toml` or `.rustfmt.toml`. My editor automatically invokes `rustfmt` on individual files on save. Unless `rustfmt` sees a specified edition, it assumes 2018, and rejects any code that uses `async`. This is a huge pain.

Specify `edition = "2021"` in `.rustfmt.toml` so that standalone `rustfmt` works.

Signed-off-by: Phoebe Goldman <phoebe@clockworklabs.io>
  • Loading branch information
gefjon authored Sep 4, 2024
1 parent b625694 commit 778f48e
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions .rustfmt.toml
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
max_width = 120
edition = "2021"

0 comments on commit 778f48e

Please sign in to comment.