rustfmt icon indicating copy to clipboard operation
rustfmt copied to clipboard

Add `let_chain_style` configuration option

Open ytmimi opened this issue 2 years ago • 1 comments

This is a follow up to #5910, which added support for let-chains.

Now users have some control over how let-chains are formatted. The default value of LegibleBindings follows the style guide prescription defined in r-l/rust#110568. The Tall variant provides users an option to format all chain items on a single line if they fit.

Happy to bike shed on the variant names, but I wanted to get the ball rolling on the new configuration.

r? @calebcartwright

ytmimi avatar Dec 17 '23 22:12 ytmimi

This one would be really nice to have, as rustfmt currently explodes even the most trivial let chains into three lines unconditionally.

awused avatar Aug 06 '25 18:08 awused