dtolnay/cargo-expand

Make it possible to format the expanded code given some rustfmt.toml configuration

Robbepop opened this issue · 1 comments

From what I can see in the code it is currently not possible to use a custom configuration for the formatting of the expanded code via rustfmt.
It would be nice if we had an option like --rustfmt-config-path <PATH> that enables us to use custom rustfmt configs to expand code.
I personally find the defaults that are currently in use rather unreadable in some heavily nested cases since visual indentation blocks are used that easily span hundreds of columns.

Closed since I get the feeling that for some reason rustfmt is actually not used while installed on my system and therefore the output is kinda crazy.

edit: It seems that cargo expand in fact uses rustfmt since the output of cargo expand --ugly is rather different. What can be observed though is that cargo expand has blocks of entirely unformatted code within the rest of the properly formatted code.