Open
Description
This is a follow up to rust-lang/style-team#169 (comment). Currently, rustfmt is formatting if-chains on nightly, but it uses a line-break-heavy style that is the current front-runner on rust-lang/style-team#169 and other popular styles also exist. In particular, use_small_heuristics = "Max"
is IMO a strong indication of intent from the author to not have spurious line breaks, and rustfmt should instead format let chains the same as regular binary operators, filling the line if space permits. (An option specific to if-chains is also reasonable, but use_small_heuristics = "Max"
should imply it.)
before:
if let 1 = 1
&& true
{
}
after:
if let 1 = 1 && true {}
This relates to a discussion on Zulip.
Metadata
Metadata
Assignees
Labels
No labels