Skip to content

Commit bbb2b92

Browse files
committed
docs: revert changing link to rust style guide
1 parent 2bc14c6 commit bbb2b92

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

Configurations.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2800,13 +2800,15 @@ See also [`max_width`](#max_width) and [`use_small_heuristics`](#use_small_heuri
28002800

28012801
## `style_edition`
28022802

2803-
Controls the edition of the [Rust Style Guide](https://doc.rust-lang.org/nightly/style-guide/editions.html?highlight=editions#rust-style-editions) to use for formatting ([RFC 3338])
2803+
Controls the edition of the [Rust Style Guide] to use for formatting ([RFC 3338])
28042804

28052805
- **Default value**: `"2015"`
28062806
- **Possible values**: `"2015"`, `"2018"`, `"2021"`, `"2024"` (unstable variant)
28072807
- **Stable**: No
28082808

28092809
This option is inferred from the `edition` if not specified.
2810+
2811+
See [Rust Style Editions] for details on style editions.
28102812
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.
28112813

28122814
To ensure consistent formatting, it is recommended to specify the `edition` or `style_edition` in a `rustfmt.toml` configuration file. For example:
@@ -2817,6 +2819,7 @@ style_edition = "2024"
28172819

28182820
Alternatively, you can use the `--style-edition` flag when running `rustfmt` directly.
28192821

2822+
[Rust Style Editions]: https://doc.rust-lang.org/nightly/style-guide/editions.html?highlight=editions#rust-style-editions
28202823
[Rust Style Guide]: https://doc.rust-lang.org/nightly/style-guide/
28212824
[RFC 3338]: https://rust-lang.github.io/rfcs/3338-style-evolution.html
28222825

README.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,16 +183,20 @@ edition = "2024"
183183

184184
### Style Editions
185185

186-
The option `style_edition` controls the edition of the [Rust Style Guide](https://doc.rust-lang.org/nightly/style-guide/editions.html?highlight=editions#rust-style-editions) to use for formatting ([RFC 3338](https://rust-lang.github.io/rfcs/3338-style-evolution.html))
186+
Controls the edition of the [Rust Style Guide] to use for formatting ([RFC 3338])
187187
It is inferred from `edition` if not explicitly set, and defaults to the `2015` edition.
188188

189+
See [Rust Style Editions] for details on style editions.
189190
Starting with the 2024 edition, Rust introduced changes to default formatting. This can lead to inconsistencies between `rustfmt` and `cargo fmt` if the 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.
190191

191192
To ensure consistent formatting, it is recommended to specify the `edition` or `style_edition` in a `rustfmt.toml` configuration file. For example:
192193

193194
```toml
194195
style_edition = "2024"
195196
```
197+
[Rust Style Editions]: https://doc.rust-lang.org/nightly/style-guide/editions.html?highlight=editions#rust-style-editions
198+
[Rust Style Guide]: https://doc.rust-lang.org/nightly/style-guide/
199+
[RFC 3338]: https://rust-lang.github.io/rfcs/3338-style-evolution.html
196200

197201
## Tips
198202

0 commit comments

Comments
 (0)