Is it possible to use rustfmt to format just the imports?

2.2k Views Asked by At

I've been messing around with nightly rustfmt and all its options (so many more than the stable version).

So, just out of curiosity: if I want to use rustfmt only to format my imports (the use statements), without touching the rest of the code, is it possible?

1

There are 1 best solutions below

0
On

I think it is impossible since many configurations don't have a disable option.

You can find all configurations here