Skip to content

Commit

Permalink
Add .rustfmt.toml, specify edition = "2021"
Browse files Browse the repository at this point in the history
There are two common ways to run rustfmt:

  $ cargo fmt
  $ rustfmt

In the first case, Cargo.toml will be used to configure rustfmt. In the
second case, Cargo.toml won't be used and rustfmt will assume certain
defaults. Specifically, it will default to Rust 2015 edition which for
the quick-xml project results in errors like:

[E0670]: async fn is not permitted in Rust 2015

One of the scenarios when rustfmt is called instead of cargo fmt is "rustic"
mode in emacs. The developers of "rustic" mode ask to configure .rustfmt.toml:

See: https://github.com/brotzeit/rustic?tab=readme-ov-file#edition-2018    Add .rustfmt.toml, specify edition = "2021"
  • Loading branch information
alisianoi committed May 20, 2024
1 parent 2b2b773 commit 7d19cf1
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
@@ -0,0 +1 @@
edition = "2021"

0 comments on commit 7d19cf1

Please sign in to comment.