Skip to content

Commit b8e1659

Browse files
committed
Add rustfmt.toml
We've gotten away without this file for a while. In particular, we explicitly use its default settings. However, this is occasionally problematic in certain contexts where `rustfmt` is invoked directly. Or in contexts where the Rust Edition is otherwise not specified. At least, this happens when using the Rust vim plugin. When an edition isn't explicitly specified, it defaults back to the 2015 edition. I think that there aren't a lot of rustfmt changes, and so we've been able to get away with this for a while. But it looks like something in the 2024 edition changes how imports are ordered. So to make it explicit that we want to use the 2024 edition of rustfmt, we opt into it. This is analogous to a change made to the Ruff repository somewhat recently: astral-sh/ruff#18197
1 parent 49b4501 commit b8e1659

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

rustfmt.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
edition = "2024"
2+
style_edition = "2024"

0 commit comments

Comments
 (0)