You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've just tried Rustfmt 2024 across our 20 000 line codebase. There are plenty of improvements, but there also look to be lots of cases where it's making formatting worse, by making things that are logically similar appear differently. This makes the code much more difficult to scan.
‘Things that are logically equivalent’ includes the values in arrays, vec!s or similar, as well as the arguments to functions or macros that take equivalent arguments, such as assert_eq! or, here, crate::intersect_polygons.
I think it's easiest to illustrate what I mean with a few examples of real code.
This is a result of rust-lang/rust#123751, and changing the default for overflow_delimited_expr to true instead of false when using style_edition=2024. If you're on nightly you can set overflow_delimited_expr=false.
I've just tried Rustfmt 2024 across our 20 000 line codebase. There are plenty of improvements, but there also look to be lots of cases where it's making formatting worse, by making things that are logically similar appear differently. This makes the code much more difficult to scan.
‘Things that are logically equivalent’ includes the values in arrays,
vec!
s or similar, as well as the arguments to functions or macros that take equivalent arguments, such asassert_eq!
or, here,crate::intersect_polygons
.I think it's easiest to illustrate what I mean with a few examples of real code.
This seems to happen most often in test code.
The text was updated successfully, but these errors were encountered: