File tree Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -36,10 +36,12 @@ style. The default Rust style varies by Rust edition. (Not every edition
36
36
changes the Rust style, and thus some editions have identical default styles;
37
37
Rust 2015, 2018, and 2021 all have the same default style.)
38
38
39
- By default, ` rustfmt ` and ` cargo fmt ` will use the same edition that the Rust
40
- code itself is configured to use. ` cargo fmt ` will pass ` rustfmt ` the edition
41
- specified in ` Cargo.toml ` ; for direct invocation of ` rustfmt ` ,
42
- ` rustfmt.toml ` /` .rustfmt.toml ` can also specify the ` edition ` .
39
+ Direct invocations of ` rustfmt ` obtain the edition used for parsing Rust code
40
+ from the ` edition ` option in its configuration file (` rustfmt.toml ` or
41
+ ` .rustfmt.toml ` ), or via the ` --edition ` command-line option; ` cargo fmt `
42
+ obtains the edition from the ` edition ` option in ` Cargo.toml ` and passes it to
43
+ ` rustfmt ` . By default, ` rustfmt ` and ` cargo fmt ` will use the same edition for
44
+ style as the Rust edition used for parsing.
43
45
44
46
However, when transitioning between editions, projects may want to separately
45
47
make and commit the changes for 1) transitioning to a new Rust edition and 2)
You can’t perform that action at this time.
0 commit comments