fmt-rfcs
fmt-rfcs copied to clipboard
Improve formatting of ranges whose start/end contain binary operators
An example:
count_hash + 2..s.len() - count_hash - 1
The spacing is confusing and doesn't match the precedence.
I think we should format this like:
(count_hash + 2)..(s.len() - count_hash - 1)
Note that I only think we should parenthesize endpoints when needed for clarity, so for instance:
count_hash..(s.len() - count_hash - 1)
Yes pleeeeaassseee, that would be such a nice improvement!