# rustfmt is the formatter for this tree, and these four widths are what make it agree # with how the tree is already written. Measured, not chosen: the default config wanted # 305 hunks and +1418 lines of layout, `use_small_heuristics = "Max"` wanted 308 the # other way, and this lands at 161. The reasoning is in # docs/testing.md beside the clippy rule. # # Sweeping any one of these in either direction makes the diff bigger. Measure before # changing one: `cargo fmt --check | grep -c '^Diff in'`. # The habit the tree is written to, and the measured optimum: 90 costs 268 hunks, 120 # costs 194. max_width = 100 # A call stays whole if it fits in three quarters of the line. rustfmt's default of 60 # is what expands 276 of the 305 hunks the default config wants. fn_call_width = 75 # The same for a method chain. chain_width = 65 # A small struct literal stays whole, so `Size { width: 120, height: 20 }` is not six # lines. Above the default of 18, which is what explodes it. struct_lit_width = 30