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
Hi @CliffHan - There are other factors rustfmt takes into consideration for formatting beyond just the line length.
Based on the rustfmt config options, there are additional width heuristics internally calculated which set an upper limit on the max length for things like attributes, functions, as well as chains like in your snippet.
Even though the length of the chain in your snippet does not exceed the max_width config value, it is still being wrapped to multiple lines because the length exceeds the calculated max chain width allowed on a single line.
If you'd really prefer to keep the original formatting of your chain on one line then you have a few options:
increase the max_width value in your rustfmt config file
leverage the use_small_heuristics config option (try using Off or Max) which is used for those internal max calculations.
have rustfmt ignore that block altogether via #![rustfmt::skip]:
Before "cargo fmt":
The length was 72, and after "cargo fmt":
The text was updated successfully, but these errors were encountered: