3 Rustfmt is designed to be very configurable. You can create a TOML file called `rustfmt.toml` or `.rustfmt.toml`, place it in the project or any other parent directory and it will apply the options in that file.
5 A possible content of `rustfmt.toml` or `.rustfmt.toml` might look like this:
10 reorder_imported_names = true
13 # Configuration Options
15 Below you find a detailed visual guide on all the supported configuration options of rustfmt:
17 ## `array_horizontal_layout_threshold`
19 How many elements array must have before rustfmt uses horizontal layout.
20 Use this option to prevent a huge array from being vertically formatted.
22 - **Default value**: `0`
23 - **Possible values**: any positive integer
25 **Note:** A value of `0` results in [`array_layout`](#array_layout) being applied regardless of a line's width.
30 // Each element will be placed on its own line.
46 // Each element will be placed on the same line as much as possible.
57 - **Default value**: `"Block"`
58 - **Possible values**: `"Block"`, `"Visual"`
77 let lorem = vec!["ipsum",
88 Maximum width of an array literal before falling back to vertical formatting
90 - **Default value**: `60`
91 - **Possible values**: any positive integer
93 **Note:** A value of `0` results in [`array_layout`](#array_layout) being applied regardless of a line's width.
95 #### Lines shorter than `array_width`:
97 let lorem = vec!["ipsum", "dolor", "sit", "amet", "consectetur", "adipiscing", "elit"];
100 #### Lines longer than `array_width`:
101 See [`array_layout`](#array_layout).
103 ## `attributes_on_same_line_as_field`
105 Try to put attributes on the same line as fields
107 - **Default value**: `true`
108 - **Possible values**: `true`, `false`
114 #[serde(rename = "Ipsum")] ipsum: usize,
115 #[serde(rename = "Dolor")] dolor: usize,
116 #[serde(rename = "Amet")] amet: usize,
124 #[serde(rename = "Ipsum")]
126 #[serde(rename = "Dolor")]
128 #[serde(rename = "Amet")]
133 ## `attributes_on_same_line_as_variant`
135 Try to put attributes on the same line as variants
137 - **Default value**: `true`
138 - **Possible values**: `true`, `false`
144 #[serde(skip_serializing)] Ipsum,
145 #[serde(skip_serializing)] Dolor,
146 #[serde(skip_serializing)] Amet,
154 #[serde(skip_serializing)]
156 #[serde(skip_serializing)]
158 #[serde(skip_serializing)]
167 - **Default value**: `"Block"`
168 - **Possible values**: `"Block"`, `"Visual"`
185 let lorem = ipsum.dolor()
193 See also [`chain_one_line_max`](#chain_one_line_max).
195 ## `chain_one_line_max`
197 Maximum length of a chain to fit on a single line
199 - **Default value**: `60`
200 - **Possible values**: any positive integer
202 #### Lines shorter than `chain_one_line_max`:
204 let lorem = ipsum.dolor().sit().amet().consectetur().adipiscing().elit();
207 #### Lines longer than `chain_one_line_max`:
208 See [`chain_indent`](#chain_indent).
210 ## `chain_split_single_child`
212 Split a chain with a single child if its length exceeds [`chain_one_line_max`](#chain_one_line_max).
214 - **Default value**: `false`
215 - **Possible values**: `false`, `true`
220 let files = fs::read_dir("tests/coverage/source").expect("Couldn't read source dir");
226 let files = fs::read_dir("tests/coverage/source")
227 .expect("Couldn't read source dir");
230 See also [`chain_one_line_max`](#chain_one_line_max).
232 ## `closure_block_indent_threshold`
234 How many lines a closure must have before it is block indented. -1 means never use block indent.
236 - **Default value**: `7`
237 - **Possible values**: `-1`, or any positive integer
239 #### Closures shorter than `closure_block_indent_threshold`:
250 #### Closures longer than `closure_block_indent_threshold`:
258 println!("consectetur");
259 println!("adipiscing");
264 **Note**: This option only takes effect when `fn_call_style` is set to `"Visual"`.
266 ## `combine_control_expr`
268 Combine control expressions with function calls.
270 - **Default value**: `true`
271 - **Possible values**: `true`, `false`
285 foo!(if let Some(..) = x {
298 foo!(while let Some(..) = x {
324 Maximum length of comments. No effect unless`wrap_comments = true`.
326 - **Default value**: `80`
327 - **Possible values**: any positive integer
329 **Note:** A value of `0` results in [`wrap_comments`](#wrap_comments) being applied regardless of a line's width.
331 #### Comments shorter than `comment_width`:
333 // Lorem ipsum dolor sit amet, consectetur adipiscing elit.
336 #### Comments longer than `comment_width`:
338 // Lorem ipsum dolor sit amet,
339 // consectetur adipiscing elit.
342 See also [`wrap_comments`](#wrap_comments).
344 ## `condense_wildcard_suffixes`
346 Replace strings of _ wildcards by a single .. in tuple patterns
348 - **Default value**: `false`
349 - **Possible values**: `true`, `false`
354 let (lorem, ipsum, _, _) = (1, 2, 3, 4);
360 let (lorem, ipsum, ..) = (1, 2, 3, 4);
365 Indent style for control flow statements
367 - **Default value**: `"Rfc"`
368 - **Possible values**: `"Rfc"`, `"Legacy"`
391 See also: [`control_brace_style`](#control_brace_style).
393 ## `control_brace_style`
395 Brace style for control flow constructs
397 - **Default value**: `"AlwaysSameLine"`
398 - **Possible values**: `"AlwaysNextLine"`, `"AlwaysSameLine"`, `"ClosingNextLine"`
400 #### `"AlwaysNextLine"`:
413 #### `"AlwaysSameLine"`:
423 #### `"ClosingNextLine"`:
434 ## `disable_all_formatting`
436 Don't reformat anything
438 - **Default value**: `false`
439 - **Possible values**: `true`, `false`
441 ## `error_on_line_overflow`
443 Error if unable to get all lines within max_width
445 - **Default value**: `true`
446 - **Possible values**: `true`, `false`
448 See also [`max_width`](#max_width).
452 Argument density in functions
454 - **Default value**: `"Tall"`
455 - **Possible values**: `"Compressed"`, `"CompressedIfEmpty"`, `"Tall"`, `"Vertical"`
461 fn lorem(ipsum: Ipsum, dolor: Dolor, sit: Sit, amet: Amet);
463 fn lorem(ipsum: Ipsum, dolor: Dolor, sit: Sit, amet: Amet) {
468 ipsum: Ipsum, dolor: Dolor, sit: Sit, amet: Amet, consectetur: Consectetur,
469 adipiscing: Adipiscing, elit: Elit,
473 ipsum: Ipsum, dolor: Dolor, sit: Sit, amet: Amet, consectetur: Consectetur,
474 adipiscing: Adipiscing, elit: Elit,
481 #### `"CompressedIfEmpty"`:
485 fn lorem(ipsum: Ipsum, dolor: Dolor, sit: Sit, amet: Amet);
487 fn lorem(ipsum: Ipsum, dolor: Dolor, sit: Sit, amet: Amet) {
492 ipsum: Ipsum, dolor: Dolor, sit: Sit, amet: Amet, consectetur: Consectetur,
493 adipiscing: Adipiscing, elit: Elit,
501 consectetur: onsectetur,
502 adipiscing: Adipiscing,
514 fn lorem(ipsum: Ipsum, dolor: Dolor, sit: Sit, amet: Amet);
516 fn lorem(ipsum: Ipsum, dolor: Dolor, sit: Sit, amet: Amet) {
525 consectetur: onsectetur,
526 adipiscing: Adipiscing,
535 consectetur: onsectetur,
536 adipiscing: Adipiscing,
548 fn lorem(ipsum: Ipsum,
553 fn lorem(ipsum: Ipsum,
560 fn lorem(ipsum: Ipsum,
564 consectetur: onsectetur,
565 adipiscing: Adipiscing,
568 fn lorem(ipsum: Ipsum,
572 consectetur: onsectetur,
573 adipiscing: Adipiscing,
582 Layout of function arguments and tuple structs
584 - **Default value**: `"Block"`
585 - **Possible values**: `"Block"`, `"Visual"`
592 fn lorem(ipsum: usize) {}
612 fn lorem(ipsum: usize) {}
614 fn lorem(ipsum: usize,
625 ## `fn_args_paren_newline`
627 If function argument parenthesis goes on a newline
629 - **Default value**: `false`
630 - **Possible values**: `true`, `false`
640 ) -> DolorSitAmetConsecteturAdipiscingElitLoremIpsumDolorSitAmetConsecteturAdipiscingElit {
654 ) -> DolorSitAmetConsecteturAdipiscingElitLoremIpsumDolorSitAmetConsecteturAdipiscingElit {
661 Brace style for functions
663 - **Default value**: `"SameLineWhere"`
664 - **Possible values**: `"AlwaysNextLine"`, `"PreferSameLine"`, `"SameLineWhere"`
666 #### `"AlwaysNextLine"`:
674 fn lorem(ipsum: usize)
679 fn lorem<T>(ipsum: T)
681 T: Add + Sub + Mul + Div,
687 #### `"PreferSameLine"`:
694 fn lorem(ipsum: usize) {
698 fn lorem<T>(ipsum: T)
700 T: Add + Sub + Mul + Div, {
705 #### `"SameLineWhere"`:
712 fn lorem(ipsum: usize) {
716 fn lorem<T>(ipsum: T)
718 T: Add + Sub + Mul + Div,
726 Indentation for function calls, etc.
728 - **Default value**: `"Block"`
729 - **Possible values**: `"Block"`, `"Visual"`
761 Maximum width of the args of a function call before falling back to vertical formatting
763 - **Default value**: `60`
764 - **Possible values**: any positive integer
766 **Note:** A value of `0` results in vertical formatting being applied regardless of a line's width.
768 #### Function call shorter than `fn_call_width`:
770 lorem("lorem", "ipsum", "dolor", "sit", "amet", "consectetur", "adipiscing", "elit");
773 #### Function call longer than `fn_call_width`:
775 See [`fn_call_style`](#fn_call_style).
777 ## `fn_empty_single_line`
779 Put empty-body functions on a single line
781 - **Default value**: `true`
782 - **Possible values**: `true`, `false`
797 See also [`control_brace_style`](#control_brace_style).
799 ## `fn_return_indent`
801 Location of return type in function declaration
803 - **Default value**: `"WithArgs"`
804 - **Possible values**: `"WithArgs"`, `"WithWhereClause"`
809 fn lorem(ipsum: Ipsum,
813 consectetur: Consectetur,
814 adipiscing: Adipiscing)
823 #### `"WithWhereClause"`:
826 fn lorem(ipsum: Ipsum,
830 consectetur: Consectetur,
831 adipiscing: Adipiscing)
840 **Note**: This option only takes effect when `fn_call_style` is set to `"Visual"`.
844 Put single-expression functions on a single line
846 - **Default value**: `false`
847 - **Possible values**: `true`, `false`
852 fn lorem() -> usize {
856 fn lorem() -> usize {
865 fn lorem() -> usize { 42 }
867 fn lorem() -> usize {
873 See also [`control_brace_style`](#control_brace_style).
875 ## `force_explicit_abi`
877 Always print the abi for extern items
879 - **Default value**: `true`
880 - **Possible values**: `true`, `false`
882 **Note:** Non-"C" ABIs are always printed. If `false` then "C" is removed.
888 pub static lorem: c_int;
896 pub static lorem: c_int;
900 ## `force_format_strings`
902 Always format string literals
904 - **Default value**: `false`
905 - **Possible values**: `true`, `false`
907 See [`format_strings`](#format_strings).
909 See also [`max_width`](#max_width).
913 Format string literals where necessary
915 - **Default value**: `false`
916 - **Possible values**: `true`, `false`
921 let lorem = "ipsum dolor sit amet consectetur adipiscing elit lorem ipsum dolor sit";
928 "ipsum dolor sit amet consectetur \
929 adipiscing elit lorem ipsum dolor sit";
932 See also [`force_format_strings`](#force_format_strings), [`max_width`](#max_width).
936 Indentation of generics
938 - **Default value**: `"Block"`
939 - **Possible values**: `"Block"`, `"Visual"`
949 Adipiscing: Eq = usize,
950 Consectetur: Eq = usize,
957 adipiscing: Adipiscing,
958 consectetur: Consectetur,
968 fn lorem<Ipsum: Eq = usize,
972 Adipiscing: Eq = usize,
973 Consectetur: Eq = usize,
979 adipiscing: Adipiscing,
980 consectetur: Consectetur,
989 Use tab characters for indentation, spaces for alignment
991 - **Default value**: `false`
992 - **Possible values**: `true`, `false`
997 fn lorem() -> usize {
998 42 // spaces before 42
1005 fn lorem() -> usize {
1006 42 // tabs before 42
1010 See also: [`tab_spaces`](#tab_spaces).
1012 ## `impl_empty_single_line`
1014 Put empty-body implementations on a single line
1016 - **Default value**: `true`
1017 - **Possible values**: `true`, `false`
1032 See also [`item_brace_style`](#item_brace_style).
1034 ## `indent_match_arms`
1036 Indent match arms instead of keeping them at the same indentation level as the match keyword
1038 - **Default value**: `true`
1039 - **Possible values**: `true`, `false`
1063 See also: [`match_block_trailing_comma`](#match_block_trailing_comma), [`wrap_match_arms`](#wrap_match_arms).
1067 Indent style of imports
1069 - **Default Value**: `"Visual"`
1070 - **Possible values**: `"Block"`, `"Visual"`
1090 See also: [`imports_layout`](#imports_layout).
1094 Item layout inside a imports block
1096 - **Default value**: "Mixed"
1097 - **Possible values**: "Horizontal", "HorizontalVertical", "Mixed", "Vertical"
1102 use foo::{xxx, yyy, zzz};
1104 use foo::{aaa, bbb, ccc,
1110 **Note**: This option forces to put everything on one line and may exceeds `max_width`.
1113 use foo::{xxx, yyy, zzz};
1115 use foo::{aaa, bbb, ccc, ddd, eee, fff};
1118 #### `"HorizontalVertical"`
1121 use foo::{xxx, yyy, zzz};
1146 ## `item_brace_style`
1148 Brace style for structs and enums
1150 - **Default value**: `"SameLineWhere"`
1151 - **Possible values**: `"AlwaysNextLine"`, `"PreferSameLine"`, `"SameLineWhere"`
1153 #### `"AlwaysNextLine"`:
1168 #### `"PreferSameLine"`:
1181 #### `"SameLineWhere"`:
1195 ## `match_block_trailing_comma`
1197 Put a trailing comma after a block based match arm (non-block arms are not affected)
1199 - **Default value**: `false`
1200 - **Possible values**: `true`, `false`
1209 Lorem::Dolor => println!("dolor"),
1220 Lorem::Dolor => println!("dolor"),
1224 See also: [`indent_match_arms`](#indent_match_arms), [`trailing_comma`](#trailing_comma), [`wrap_match_arms`](#wrap_match_arms).
1226 ## `match_pattern_separator_break_point`
1228 Put a match sub-patterns' separator (`|`) in front or back.
1230 - **Default value**: `"Back"`
1231 - **Possible values**: `"Back"`, `"Front"`
1255 | Variant::Tag6 => {}
1261 Maximum width of each line
1263 - **Default value**: `100`
1264 - **Possible values**: any positive integer
1266 See also [`error_on_line_overflow`](#error_on_line_overflow).
1270 Merge multiple derives into a single one.
1272 - **Default value**: `true`
1273 - **Possible values**: `true`, `false`
1275 *Note*: The merged derives will be put after all other attributes or doc comments.
1280 #[derive(Eq, PartialEq, Debug, Copy, Clone)]
1287 #[derive(Eq, PartialEq)]
1289 #[derive(Copy, Clone)]
1293 ## `multiline_closure_forces_block`
1295 Force multiline closure bodies to be wrapped in a block
1297 - **Default value**: `false`
1298 - **Possible values**: `false`, `true`
1304 result.and_then(|maybe_value| {
1315 result.and_then(|maybe_value| match maybe_value {
1321 ## `multiline_match_arm_forces_block`
1323 Force multiline match arm bodies to be wrapped in a block
1325 - **Default value**: `false`
1326 - **Possible values**: `false`, `true`
1333 println!("Hello World");
1345 println!("Hello World");
1354 Unix or Windows line endings
1356 - **Default value**: `"Unix"`
1357 - **Possible values**: `"Native"`, `"Unix"`, `"Windows"`
1359 ## `normalize_comments`
1361 Convert /* */ comments to // comments where possible
1363 - **Default value**: `false`
1364 - **Possible values**: `true`, `false`
1370 fn dolor() -> usize {}
1373 fn adipiscing() -> usize {}
1380 fn dolor() -> usize {}
1383 fn adipiscing() -> usize {}
1386 ## `reorder_imported_names`
1388 Reorder lists of names in import statements alphabetically
1390 - **Default value**: `false`
1391 - **Possible values**: `true`, `false`
1396 use super::{lorem, ipsum, dolor, sit};
1402 use super::{dolor, ipsum, lorem, sit};
1405 See also [`reorder_imports`](#reorder_imports).
1407 ## `reorder_imports`
1409 Reorder import statements alphabetically
1411 - **Default value**: `false`
1412 - **Possible values**: `true`, `false`
1432 See also [`reorder_imported_names`](#reorder_imported_names), [`reorder_imports_in_group`](#reorder_imports_in_group).
1434 ## `reorder_imports_in_group`
1436 Reorder import statements in group
1438 - **Default value**: `false`
1439 - **Possible values**: `true`, `false`
1441 **Note:** This option takes effect only when [`reorder_imports`](#reorder_imports) is set to `true`.
1467 See also [`reorder_imports`](#reorder_imports).
1469 ## `single_line_if_else_max_width`
1471 Maximum line length for single line if-else expressions.
1473 - **Default value**: `50`
1474 - **Possible values**: any positive integer
1476 **Note:** A value of `0` results in if-else expressions being broken regardless of their line's width.
1478 #### Lines shorter than `single_line_if_else_max_width`:
1480 let lorem = if ipsum { dolor } else { sit };
1483 #### Lines longer than `single_line_if_else_max_width`:
1485 let lorem = if ipsum {
1492 See also: [`control_brace_style`](#control_brace_style).
1496 Don't reformat out of line modules
1498 - **Default value**: `false`
1499 - **Possible values**: `true`, `false`
1501 ## `space_after_bound_colon`
1503 Leave a space after the colon in a trait or lifetime bound
1505 - **Default value**: `true`
1506 - **Possible values**: `true`, `false`
1511 fn lorem<T:Eq>(t: T) {
1519 fn lorem<T: Eq>(t: T) {
1524 See also: [`space_before_bound`](#space_before_bound).
1526 ## `struct_field_align_threshold`
1528 The maximum diff of width between struct fields to be aligned with each other.
1530 - **Default value** : 0
1531 - **Possible values**: any positive integer
1553 ## `space_after_struct_lit_field_colon`
1555 Leave a space after the colon in a struct literal field
1557 - **Default value**: `true`
1558 - **Possible values**: `true`, `false`
1578 See also: [`space_before_struct_lit_field_colon`](#space_before_struct_lit_field_colon).
1580 ## `space_after_type_annotation_colon`
1582 Leave a space after the colon in a type annotation
1584 - **Default value**: `true`
1585 - **Possible values**: `true`, `false`
1590 fn lorem<T: Eq>(t:T) {
1591 let ipsum:Dolor = sit;
1598 fn lorem<T: Eq>(t: T) {
1599 let ipsum: Dolor = sit;
1603 See also: [`space_before_type_annotation`](#space_before_type_annotation).
1605 ## `space_before_bound`
1607 Leave a space before the colon in a trait or lifetime bound
1609 - **Default value**: `false`
1610 - **Possible values**: `true`, `false`
1615 fn lorem<T: Eq>(t: T) {
1616 let ipsum: Dolor = sit;
1623 fn lorem<T : Eq>(t: T) {
1624 let ipsum: Dolor = sit;
1628 See also: [`space_after_bound_colon`](#space_after_bound_colon).
1630 ## `space_before_struct_lit_field_colon`
1632 Leave a space before the colon in a struct literal field
1634 - **Default value**: `false`
1635 - **Possible values**: `true`, `false`
1655 See also: [`space_after_struct_lit_field_colon`](#space_after_struct_lit_field_colon).
1657 ## `space_before_type_annotation`
1659 Leave a space before the colon in a type annotation
1661 - **Default value**: `false`
1662 - **Possible values**: `true`, `false`
1667 fn lorem<T: Eq>(t: T) {
1668 let ipsum: Dolor = sit;
1675 fn lorem<T: Eq>(t : T) {
1676 let ipsum : Dolor = sit;
1680 See also: [`space_after_type_annotation_colon`](#space_after_type_annotation_colon).
1682 ## `spaces_around_ranges`
1684 Put spaces around the .. and ... range operators
1686 - **Default value**: `false`
1687 - **Possible values**: `true`, `false`
1698 let lorem = 0 .. 10;
1701 ## `spaces_within_angle_brackets`
1703 Put spaces within non-empty generic arguments
1705 - **Default value**: `false`
1706 - **Possible values**: `true`, `false`
1711 fn lorem<T: Eq>(t: T) {
1719 fn lorem< T: Eq >(t: T) {
1724 See also: [`spaces_within_parens`](#spaces_within_parens), [`spaces_within_square_brackets`](#spaces_within_square_brackets).
1726 ## `spaces_within_parens`
1728 Put spaces within non-empty parentheses
1730 - **Default value**: `false`
1731 - **Possible values**: `true`, `false`
1736 fn lorem<T: Eq>(t: T) {
1737 let lorem = (ipsum, dolor);
1744 fn lorem<T: Eq>( t: T ) {
1745 let lorem = ( ipsum, dolor );
1749 See also: [`spaces_within_angle_brackets`](#spaces_within_angle_brackets), [`spaces_within_square_brackets`](#spaces_within_square_brackets).
1751 ## `spaces_within_square_brackets`
1753 Put spaces within non-empty square brackets
1755 - **Default value**: `false`
1756 - **Possible values**: `true`, `false`
1761 let lorem: [usize; 2] = [ipsum, dolor];
1767 let lorem: [ usize; 2 ] = [ ipsum, dolor ];
1770 See also: [`spaces_within_parens`](#spaces_within_parens), [`spaces_within_angle_brackets`](#spaces_within_angle_brackets).
1772 ## `struct_lit_multiline_style`
1774 Multiline style on literal structs
1776 - **Default value**: `"PreferSingle"`
1777 - **Possible values**: `"ForceMulti"`, `"PreferSingle"`
1779 #### `"ForceMulti"`:
1788 #### `"PreferSingle"`:
1791 let lorem = Lorem { ipsum: dolor, sit: amet };
1794 See also: [`struct_lit_style`](#struct_lit_style), [`struct_lit_width`](#struct_lit_width).
1796 ## `struct_lit_style`
1798 Style of struct definition
1800 - **Default value**: `"Block"`
1801 - **Possible values**: `"Block"`, `"Visual"`
1815 let lorem = Lorem { ipsum: dolor,
1819 See also: [`struct_lit_multiline_style`](#struct_lit_multiline_style), [`struct_lit_style`](#struct_lit_style).
1821 ## `struct_lit_width`
1823 Maximum width in the body of a struct lit before falling back to vertical formatting
1825 - **Default value**: `18`
1826 - **Possible values**: any positive integer
1828 **Note:** A value of `0` results in vertical formatting being applied regardless of a line's width.
1830 #### Lines shorter than `struct_lit_width`:
1832 let lorem = Lorem { ipsum: dolor, sit: amet };
1835 #### Lines longer than `struct_lit_width`:
1836 See [`struct_lit_style`](#struct_lit_style).
1838 See also: [`struct_lit_multiline_style`](#struct_lit_multiline_style), [`struct_lit_style`](#struct_lit_style).
1840 ## `struct_variant_width`
1842 Maximum width in the body of a struct variant before falling back to vertical formatting
1844 - **Default value**: `35`
1845 - **Possible values**: any positive integer
1847 **Note:** A value of `0` results in vertical formatting being applied regardless of a line's width.
1849 #### Struct variants shorter than `struct_variant_width`:
1854 Sit { amet: Consectetur, adipiscing: Elit },
1858 #### Struct variants longer than `struct_variant_width`:
1872 Number of spaces per tab
1874 - **Default value**: `4`
1875 - **Possible values**: any positive integer
1881 let ipsum = dolor();
1883 "amet consectetur adipiscing elit."
1892 let ipsum = dolor();
1894 "amet consectetur adipiscing elit."
1899 See also: [`hard_tabs`](#hard_tabs).
1901 ## `take_source_hints`
1903 Retain some formatting characteristics from the source code
1905 - **Default value**: `false`
1906 - **Possible values**: `true`, `false`
1913 .dolor(|| { sit.amet().consectetur().adipiscing().elit(); });
1929 Note: This only applies if the call chain within the inner closure had already been formatted on separate lines before running rustfmt.
1933 How to handle trailing commas for lists
1935 - **Default value**: `"Vertical"`
1936 - **Possible values**: `"Always"`, `"Never"`, `"Vertical"`
1941 let Lorem { ipsum, dolor, sit, } = amet;
1955 let Lorem { ipsum, dolor, sit } = amet;
1969 let Lorem { ipsum, dolor, sit } = amet;
1980 See also: [`match_block_trailing_comma`](#match_block_trailing_comma).
1982 ## `trailing_semicolon`
1984 Add trailing semicolon after break, continue and return
1986 - **Default value**: `true`
1987 - **Possible values**: `true`, `false`
2003 ## `type_punctuation_density`
2005 Determines if `+` or `=` are wrapped in spaces in the punctuation of types
2007 - **Default value**: `"Wide"`
2008 - **Possible values**: `"Compressed"`, `"Wide"`
2010 #### `"Compressed"`:
2013 fn lorem<Ipsum: Dolor+Sit=Amet>() {
2021 fn lorem<Ipsum: Dolor + Sit = Amet>() {
2026 ## `use_try_shorthand`
2028 Replace uses of the try! macro by the ? shorthand
2030 - **Default value**: `false`
2031 - **Possible values**: `true`, `false`
2036 let lorem = try!(ipsum.map(|dolor|dolor.sit()));
2042 let lorem = ipsum.map(|dolor| dolor.sit())?;
2047 Density of a where clause.
2049 - **Default value**: `"CompressedIfEmpty"`
2050 - **Possible values**: `"Compressed"`, `"CompressedIfEmpty"`, `"Tall"`, `"Vertical"`
2052 #### `"Compressed"`:
2056 fn ipsum<Dolor>(dolor: Dolor) -> Sit
2059 fn ipsum<Dolor>(dolor: Dolor) -> Sit
2066 #### `"CompressedIfEmpty"`:
2070 fn ipsum<Dolor>(dolor: Dolor) -> Sit
2073 fn ipsum<Dolor>(dolor: Dolor) -> Sit
2086 fn ipsum<Dolor>(dolor: Dolor) -> Sit
2090 fn ipsum<Dolor>(dolor: Dolor) -> Sit
2099 **Note:** `where_density = "Tall"` currently produces the same output as `where_density = "Vertical"`.
2105 fn ipsum<Dolor>(dolor: Dolor) -> Sit
2108 fn ipsum<Dolor>(dolor: Dolor) -> Sit
2116 **Note:** `where_density = "Vertical"` currently produces the same output as `where_density = "Tall"`.
2118 See also: [`where_layout`](#where_layout), [`where_pred_indent`](#where_pred_indent), [`where_style`](#where_style).
2122 Element layout inside a where clause
2124 - **Default value**: `"Vertical"`
2125 - **Possible values**: `"Horizontal"`, `"HorizontalVertical"`, `"Mixed"`, `"Vertical"`
2127 #### `"Horizontal"`:
2130 fn lorem<Ipsum, Dolor>(ipsum: Ipsum, dolor: Dolor)
2131 where Ipsum: IpsumDolorSitAmet, Dolor: DolorSitAmetConsectetur
2136 fn lorem<Ipsum, Dolor, Sit, Amet>(ipsum: Ipsum, dolor: Dolor, sit: Sit, amet: Amet)
2137 where Ipsum: IpsumDolorSitAmet, Dolor: DolorSitAmetConsectetur, Sit: SitAmetConsecteturAdipiscing, Amet: AmetConsecteturAdipiscingElit
2143 #### `"HorizontalVertical"`:
2146 fn lorem<Ipsum, Dolor>(ipsum: Ipsum, dolor: Dolor)
2147 where Ipsum: IpsumDolorSitAmet, Dolor: DolorSitAmetConsectetur
2152 fn lorem<Ipsum, Dolor, Sit, Amet>(ipsum: Ipsum, dolor: Dolor, sit: Sit, amet: Amet)
2153 where Ipsum: IpsumDolorSitAmet,
2154 Dolor: DolorSitAmetConsectetur,
2155 Sit: SitAmetConsecteturAdipiscing,
2156 Amet: AmetConsecteturAdipiscingElit
2165 fn lorem<Ipsum, Dolor>(ipsum: Ipsum, dolor: Dolor)
2166 where Ipsum: IpsumDolorSitAmet, Dolor: DolorSitAmetConsectetur
2171 fn lorem<Ipsum, Dolor, Sit, Amet>(ipsum: Ipsum, dolor: Dolor, sit: Sit, amet: Amet)
2172 where Ipsum: IpsumDolorSitAmet, Dolor: DolorSitAmetConsectetur,
2173 Sit: SitAmetConsecteturAdipiscing, Amet: AmetConsecteturAdipiscingElit
2182 fn lorem<Ipsum, Dolor>(ipsum: Ipsum, dolor: Dolor)
2183 where Ipsum: IpsumDolorSitAmet,
2184 Dolor: DolorSitAmetConsectetur
2189 fn lorem<Ipsum, Dolor, Sit, Amet>(ipsum: Ipsum, dolor: Dolor, sit: Sit, amet: Amet)
2190 where Ipsum: IpsumDolorSitAmet,
2191 Dolor: DolorSitAmetConsectetur,
2192 Sit: SitAmetConsecteturAdipiscing,
2193 Amet: AmetConsecteturAdipiscingElit
2199 **Note**: This option only takes effect when `where_style` is set to `"Legacy"`.
2201 See also: [`where_density`](#where_density), [`where_pred_indent`](#where_pred_indent), [`where_style`](#where_style).
2203 ## `where_pred_indent`
2205 Indentation style of a where predicate
2207 - **Default value**: `"Visual"`
2208 - **Possible values**: `"Block"`, `"Visual"`
2213 fn lorem<Ipsum, Dolor, Sit, Amet>() -> T
2226 fn lorem<Ipsum, Dolor, Sit, Amet>() -> T
2236 **Note**: This option only takes effect when `where_style` is set to `"Legacy"`.
2238 See also: [`where_density`](#where_density), [`where_layout`](#where_layout), [`where_style`](#where_style).
2242 Overall strategy for where clauses
2244 - **Default value**: `"Rfc"`
2245 - **Possible values**: `"Rfc"`, `"Legacy"`
2250 fn lorem<Ipsum, Dolor, Sit, Amet>() -> T
2264 fn lorem<Ipsum, Dolor, Sit, Amet>() -> T
2274 See also: [`where_density`](#where_density), [`where_layout`](#where_layout), [`where_pred_indent`](#where_pred_indent).
2278 Break comments to fit on the line
2280 - **Default value**: `false`
2281 - **Possible values**: `true`, `false`
2286 // Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
2292 // Lorem ipsum dolor sit amet, consectetur adipiscing elit,
2293 // sed do eiusmod tempor incididunt ut labore et dolore
2294 // magna aliqua. Ut enim ad minim veniam, quis nostrud
2295 // exercitation ullamco laboris nisi ut aliquip ex ea
2296 // commodo consequat.
2299 ## `wrap_match_arms`
2301 Wrap the body of arms in blocks when it does not fit on the same line with the pattern of arms
2303 - **Default value**: `true`
2304 - **Possible values**: `true`, `false`
2311 foooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo(x),
2312 false => println!("{}", sit),
2321 foooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo(x)
2323 false => println!("{}", sit),
2327 See also: [`indent_match_arms`](#indent_match_arms), [`match_block_trailing_comma`](#match_block_trailing_comma).
2331 What Write Mode to use when none is supplied: Replace, Overwrite, Display, Diff, Coverage
2333 - **Default value**: `"Overwrite"`
2334 - **Possible values**: `"Checkstyle"`, `"Coverage"`, `"Diff"`, `"Display"`, `"Overwrite"`, `"Plain"`, `"Replace"`