Skip to content

Commit

Permalink
docs: link to edition in style_edition section
Browse files Browse the repository at this point in the history
  • Loading branch information
karolzwolak committed Feb 25, 2025
1 parent cc598ed commit 3085143
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Configurations.md
Original file line number Diff line number Diff line change
Expand Up @@ -2753,12 +2753,12 @@ Controls the edition of the [Rust Style Guide] to use for formatting ([RFC 3338]
- **Possible values**: `"2015"`, `"2018"`, `"2021"`, `"2024"` (unstable variant)
- **Stable**: No

This option is inferred from the `edition` if not specified.
This option is inferred from the [`edition`](#edition) if not specified.

See [Rust Style Editions] for details on style editions.
Starting with the 2024 edition, Rust introduced changes to default formatting. This can lead to inconsistencies between `rustfmt` and `cargo fmt` if the style edition is not explicitly configured. This is because `cargo fmt` automatically picks up the edition from `Cargo.toml`, while `rustfmt` defaults to the `2015` edition unless otherwise specified.

To ensure consistent formatting, it is recommended to specify the `edition` or `style_edition` in a `rustfmt.toml` configuration file. For example:
To ensure consistent formatting, it is recommended to specify the [`edition`](#edition) or `style_edition` in a `rustfmt.toml` configuration file. For example:

```toml
style_edition = "2024"
Expand Down

0 comments on commit 3085143

Please sign in to comment.