Skip to content

Commit d884f1d

Browse files
committed
docs: link to edition in style_edition section
1 parent 5a127fa commit d884f1d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Configurations.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2753,12 +2753,12 @@ Controls the edition of the [Rust Style Guide] to use for formatting ([RFC 3338]
27532753
- **Possible values**: `"2015"`, `"2018"`, `"2021"`, `"2024"` (unstable variant)
27542754
- **Stable**: No
27552755

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

27582758
See [Rust Style Editions] for details on style editions.
27592759
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.
27602760

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

27632763
```toml
27642764
style_edition = "2024"

0 commit comments

Comments
 (0)