Multiline long params with attributes #4059
Labels
good first issue
Issues up for grabs, also good candidates for new rustfmt contributors
hacktoberfest
help wanted
poor-formatting
Formatting of params with attributes should be multilined if the formatting result length exceeds
max_width
.rustfmt does this in the vast majority of cases, but there is currently an edge case where rustfmt falls back to the original one-line snippet for the param
this snippet:
is formatted to:
It seems that all of the below conditions must be true in order for the line to not be split as desired:
I suspect that the
rewrite
forParam
is what would need to be tweaked to handle this case:rustfmt/rustfmt-core/rustfmt-lib/src/items.rs
Lines 2047 to 2100 in 4464ab7
Refs #4047
The text was updated successfully, but these errors were encountered: