Skip to content

Commit 21852b6

Browse files
committed
docs: link to edition in style_edition section
1 parent bbb2b92 commit 21852b6

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
@@ -2806,12 +2806,12 @@ Controls the edition of the [Rust Style Guide] to use for formatting ([RFC 3338]
28062806
- **Possible values**: `"2015"`, `"2018"`, `"2021"`, `"2024"` (unstable variant)
28072807
- **Stable**: No
28082808

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

28112811
See [Rust Style Editions] for details on style editions.
28122812
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.
28132813

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

28162816
```toml
28172817
style_edition = "2024"

0 commit comments

Comments
 (0)