Running rustfmt on rust-lang/rust and other rust-lang repositories


use_small_heuristics = "Max" is confirmed to work great on my code and reduce churn.

Here are some stats from formatting changes:
use_small_heuristics = "Default"

src/librustc_privacy/                 |  574 ++++--
src/librustc_resolve/ |  576 ++++--
src/librustc_resolve/        |   65 +-
src/librustc_resolve/     |   46 +-
src/librustc_resolve/                 | 2756 ++++++++++++++++-----------
src/librustc_resolve/              |  646 +++++--
src/librustc_resolve/     | 1008 ++++++----

use_small_heuristics = "Max"

src/librustc_privacy/                 |  466 ++---
src/librustc_resolve/ |  463 +++--
src/librustc_resolve/        |   55 +-
src/librustc_resolve/     |   23 +-
src/librustc_resolve/                 | 2426 +++++++++++++++------------
src/librustc_resolve/              |  555 +++---
src/librustc_resolve/     |  913 ++++++----

The remaining churn is mostly the switch from visual indentation to block indentation, which is okay and expected, and is indeed a consensus of the style RFC process.


The only notable exception not fixed by use_small_heuristics = "Max" is if-else at the end of the block, but it looks like a fix was in progress, but is stuck now.


Haha, personally I’m still wishing that 2-space indentation had won out over 4-space indentation in the early days, as IMO all Rust code looks 1000x better that way. Too late now, of course! I’m content knowing that rustfmt.toml is a thing for my own personal projects, at least. :smile:

I strongly disagree with the suggestions I sometimes hear about how rustfmt should not be configurable at all and that something like the gofmt approach is more desirable. No thanks! Caring about how code is formatted to that extent is just a bit much I think.