Rustfmt – at time of this writing – has around 65 configs ( $ rustfmt --config-help ) that can be customized to one’s personal style.

I was trying to improve rustfmt’s formatting style of a quite large project of mine today and got lost figuring out what each config did, shortly after, for a lack of code samples.

So I went ahead and wrote a quick visual guide based on my research:

GitHub regexident/rustfmt-configs-guide rustfmt-configs-guide - A visual guide for rustfmt's configs

There are still a bunch of configurations (10) and/or their respective code samples (18) missing (just ⌘f for FIXME ). So if you happen to know what the missing configurations do and how to visualize their effect in a way that matches the rest of the code samples, or have any other kind of improvements, please feel free to make a PR.

Once complete there might be interest to merge the guide into the official rustfmt project, maybe? Also rustfmt appears to be lacking isolated tests for each config right now, for which the code samples might be a fitting starting point as well. Yay, nay … @nrc?