Indentation in closures gets formatted twice and result is not nice™ #4616
Labels
a-closures
bug
Panic, non-idempotency, invalid code, etc.
only-with-option
requires a non-default option value to reproduce
Describe the bug
On first invocation of rustfmt closure code gets formatted (nicely, arguably). On any subsequent iteration it gets formatted again (not so nicely, arguably).
To Reproduce
Throw the following in a
test.rs
file:and put the following in a
rustfmt.toml
file in the same directory:Now invoke rustfmt on file
test.rs
once. The following should happen:Now invoke rustfmt on file
test.rs
again, and the following should happen:Subsequent invocations should not make a difference. Differing settings for
max_width
(we use 79 characters) produce similar output.Expected behavior
rustfmt should certainly not take two invocations to format a section of code. Personally I think the output after the first invocation is the intended one.
Meta
The text was updated successfully, but these errors were encountered: