I have a rustfmt.toml like so:
width_heuristics = "Max"
And when I run rustfmt, I get the following error
Error: Decoding config file failed:
invalid type: string "Max", expected struct WidthHeuristics for key `width_heuristics`
Please check your config file.
Version rustfmt 1.4.14-nightly (a5cb5d2 2020-04-14)
Apologies for the confusion @chrisvittal.
Since you are using the released rustfmt 1.4.14 version, you'll need to use the use_small_heuristics config option.
As part of the upcoming rustfmt 2.0 release we're refactoring the width heuristics configuration options to give users more granular control, and the latest Configuration documentation (https://github.com/rust-lang/rustfmt/blob/master/Configurations.md and http://rust-lang.github.io/rustfmt/) is reflective of those rustfmt 2.0 changes.
rustfmt 2.0 (and new/updated config opts like width_heuristics) are currently only available when building rustfmt from source.
Most helpful comment
Apologies for the confusion @chrisvittal.
Since you are using the released rustfmt 1.4.14 version, you'll need to use the
use_small_heuristicsconfig option.As part of the upcoming rustfmt 2.0 release we're refactoring the width heuristics configuration options to give users more granular control, and the latest Configuration documentation (https://github.com/rust-lang/rustfmt/blob/master/Configurations.md and http://rust-lang.github.io/rustfmt/) is reflective of those rustfmt 2.0 changes.
rustfmt 2.0 (and new/updated config opts like
width_heuristics) are currently only available when building rustfmt from source.