fix(.rustfmt.toml): specify Rust edition 2021 (#1722)

* fix(.rustfmt.toml): specify Rust edition 2021

Emacs' popular Rust plugin Rustic [1] uses `rustfmt` to format code. `rustfmt`
only picks up the Rust edition from `Cargo.toml` when executed through `cargo fmt` [2] [3].

This commit duplicates the Rust edition in the `.rustfmt.toml` file. Thus all
users of `rustfmt` (whether through `cargo fmt` or plain `rustfmt`) will get
formatting according to their Rust edition, e.g. helpful when interacting with
`async` code.

[1]: https://github.com/brotzeit/rustic
[2]: https://github.com/brotzeit/rustic?tab=readme-ov-file#edition-2018
[3]: https://github.com/rust-lang/rustfmt?tab=readme-ov-file#rusts-editions

* Document keeping edition statements in sync
This commit is contained in:
Max Inden 2024-03-08 09:08:47 +01:00 коммит произвёл GitHub
Родитель 4a6ec6f597
Коммит 3476bd0545
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: B5690EEEBB952194
2 изменённых файлов: 8 добавлений и 0 удалений

Просмотреть файл

@ -1,3 +1,10 @@
# Keep in sync with `Cargo.toml` `edition`.
#
# `rustfmt` envoked not through `cargo fmt` but directly does not pick up Rust
# edition in `Cargo.toml`. Thus duplicate here. See
# https://github.com/mozilla/neqo/pull/1722 for details.
edition = "2021"
comment_width=100
wrap_comments=true

Просмотреть файл

@ -16,6 +16,7 @@ homepage = "https://github.com/mozilla/neqo/"
repository = "https://github.com/mozilla/neqo/"
authors = ["The Neqo Authors <necko@mozilla.com>"]
version = "0.7.1"
# Keep in sync with `.rustfmt.toml` `edition`.
edition = "2021"
license = "MIT OR Apache-2.0"
# Don't increase beyond what Firefox is currently using: