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).
107 - **Default value**: `"Block"`
108 - **Possible values**: `"Block"`, `"Visual"`
125 let lorem = ipsum.dolor()
133 See also [`chain_one_line_max`](#chain_one_line_max).
135 ## `chain_one_line_max`
137 Maximum length of a chain to fit on a single line
139 - **Default value**: `60`
140 - **Possible values**: any positive integer
142 #### Lines shorter than `chain_one_line_max`:
144 let lorem = ipsum.dolor().sit().amet().consectetur().adipiscing().elit();
147 #### Lines longer than `chain_one_line_max`:
148 See [`chain_indent`](#chain_indent).
150 ## `chain_split_single_child`
152 Split a chain with a single child if its length exceeds [`chain_one_line_max`](#chain_one_line_max).
154 - **Default value**: `false`
155 - **Possible values**: `false`, `true`
160 let files = fs::read_dir("tests/coverage/source").expect("Couldn't read source dir");
166 let files = fs::read_dir("tests/coverage/source")
167 .expect("Couldn't read source dir");
170 See also [`chain_one_line_max`](#chain_one_line_max).
172 ## `closure_block_indent_threshold`
174 How many lines a closure must have before it is block indented. -1 means never use block indent.
176 - **Default value**: `7`
177 - **Possible values**: `-1`, or any positive integer
179 #### Closures shorter than `closure_block_indent_threshold`:
190 #### Closures longer than `closure_block_indent_threshold`:
198 println!("consectetur");
199 println!("adipiscing");
204 **Note**: This option only takes effect when `fn_call_style` is set to `"Visual"`.
206 ## `combine_control_expr`
208 Combine control expressions with function calls.
210 - **Default value**: `true`
211 - **Possible values**: `true`, `false`
225 foo!(if let Some(..) = x {
238 foo!(while let Some(..) = x {
264 Maximum length of comments. No effect unless`wrap_comments = true`.
266 - **Default value**: `80`
267 - **Possible values**: any positive integer
269 **Note:** A value of `0` results in [`wrap_comments`](#wrap_comments) being applied regardless of a line's width.
271 #### Comments shorter than `comment_width`:
273 // Lorem ipsum dolor sit amet, consectetur adipiscing elit.
276 #### Comments longer than `comment_width`:
278 // Lorem ipsum dolor sit amet,
279 // consectetur adipiscing elit.
282 See also [`wrap_comments`](#wrap_comments).
284 ## `condense_wildcard_suffixes`
286 Replace strings of _ wildcards by a single .. in tuple patterns
288 - **Default value**: `false`
289 - **Possible values**: `true`, `false`
294 let (lorem, ipsum, _, _) = (1, 2, 3, 4);
300 let (lorem, ipsum, ..) = (1, 2, 3, 4);
305 Indent style for control flow statements
307 - **Default value**: `"Rfc"`
308 - **Possible values**: `"Rfc"`, `"Legacy"`
331 See also: [`control_brace_style`](#control_brace_style).
333 ## `control_brace_style`
335 Brace style for control flow constructs
337 - **Default value**: `"AlwaysSameLine"`
338 - **Possible values**: `"AlwaysNextLine"`, `"AlwaysSameLine"`, `"ClosingNextLine"`
340 #### `"AlwaysNextLine"`:
353 #### `"AlwaysSameLine"`:
363 #### `"ClosingNextLine"`:
374 ## `disable_all_formatting`
376 Don't reformat anything
378 - **Default value**: `false`
379 - **Possible values**: `true`, `false`
381 ## `error_on_line_overflow`
383 Error if unable to get all lines within max_width
385 - **Default value**: `true`
386 - **Possible values**: `true`, `false`
388 See also [`max_width`](#max_width).
392 Argument density in functions
394 - **Default value**: `"Tall"`
395 - **Possible values**: `"Compressed"`, `"CompressedIfEmpty"`, `"Tall"`, `"Vertical"`
401 fn lorem(ipsum: Ipsum, dolor: Dolor, sit: Sit, amet: Amet);
403 fn lorem(ipsum: Ipsum, dolor: Dolor, sit: Sit, amet: Amet) {
408 ipsum: Ipsum, dolor: Dolor, sit: Sit, amet: Amet, consectetur: Consectetur,
409 adipiscing: Adipiscing, elit: Elit,
413 ipsum: Ipsum, dolor: Dolor, sit: Sit, amet: Amet, consectetur: Consectetur,
414 adipiscing: Adipiscing, elit: Elit,
421 #### `"CompressedIfEmpty"`:
425 fn lorem(ipsum: Ipsum, dolor: Dolor, sit: Sit, amet: Amet);
427 fn lorem(ipsum: Ipsum, dolor: Dolor, sit: Sit, amet: Amet) {
432 ipsum: Ipsum, dolor: Dolor, sit: Sit, amet: Amet, consectetur: Consectetur,
433 adipiscing: Adipiscing, elit: Elit,
441 consectetur: onsectetur,
442 adipiscing: Adipiscing,
454 fn lorem(ipsum: Ipsum, dolor: Dolor, sit: Sit, amet: Amet);
456 fn lorem(ipsum: Ipsum, dolor: Dolor, sit: Sit, amet: Amet) {
465 consectetur: onsectetur,
466 adipiscing: Adipiscing,
475 consectetur: onsectetur,
476 adipiscing: Adipiscing,
488 fn lorem(ipsum: Ipsum,
493 fn lorem(ipsum: Ipsum,
500 fn lorem(ipsum: Ipsum,
504 consectetur: onsectetur,
505 adipiscing: Adipiscing,
508 fn lorem(ipsum: Ipsum,
512 consectetur: onsectetur,
513 adipiscing: Adipiscing,
522 Layout of function arguments and tuple structs
524 - **Default value**: `"Block"`
525 - **Possible values**: `"Block"`, `"Visual"`
532 fn lorem(ipsum: usize) {}
552 fn lorem(ipsum: usize) {}
554 fn lorem(ipsum: usize,
565 ## `fn_args_paren_newline`
567 If function argument parenthesis goes on a newline
569 - **Default value**: `false`
570 - **Possible values**: `true`, `false`
580 ) -> DolorSitAmetConsecteturAdipiscingElitLoremIpsumDolorSitAmetConsecteturAdipiscingElit {
594 ) -> DolorSitAmetConsecteturAdipiscingElitLoremIpsumDolorSitAmetConsecteturAdipiscingElit {
601 Brace style for functions
603 - **Default value**: `"SameLineWhere"`
604 - **Possible values**: `"AlwaysNextLine"`, `"PreferSameLine"`, `"SameLineWhere"`
606 #### `"AlwaysNextLine"`:
614 fn lorem(ipsum: usize)
619 fn lorem<T>(ipsum: T)
621 T: Add + Sub + Mul + Div,
627 #### `"PreferSameLine"`:
634 fn lorem(ipsum: usize) {
638 fn lorem<T>(ipsum: T)
640 T: Add + Sub + Mul + Div, {
645 #### `"SameLineWhere"`:
652 fn lorem(ipsum: usize) {
656 fn lorem<T>(ipsum: T)
658 T: Add + Sub + Mul + Div,
666 Indentation for function calls, etc.
668 - **Default value**: `"Block"`
669 - **Possible values**: `"Block"`, `"Visual"`
701 Maximum width of the args of a function call before falling back to vertical formatting
703 - **Default value**: `60`
704 - **Possible values**: any positive integer
706 **Note:** A value of `0` results in vertical formatting being applied regardless of a line's width.
708 #### Function call shorter than `fn_call_width`:
710 lorem("lorem", "ipsum", "dolor", "sit", "amet", "consectetur", "adipiscing", "elit");
713 #### Function call longer than `fn_call_width`:
715 See [`fn_call_style`](#fn_call_style).
717 ## `fn_empty_single_line`
719 Put empty-body functions on a single line
721 - **Default value**: `true`
722 - **Possible values**: `true`, `false`
737 See also [`control_brace_style`](#control_brace_style).
739 ## `fn_return_indent`
741 Location of return type in function declaration
743 - **Default value**: `"WithArgs"`
744 - **Possible values**: `"WithArgs"`, `"WithWhereClause"`
749 fn lorem(ipsum: Ipsum,
753 consectetur: Consectetur,
754 adipiscing: Adipiscing)
763 #### `"WithWhereClause"`:
766 fn lorem(ipsum: Ipsum,
770 consectetur: Consectetur,
771 adipiscing: Adipiscing)
780 **Note**: This option only takes effect when `fn_call_style` is set to `"Visual"`.
784 Put single-expression functions on a single line
786 - **Default value**: `false`
787 - **Possible values**: `true`, `false`
792 fn lorem() -> usize {
796 fn lorem() -> usize {
805 fn lorem() -> usize { 42 }
807 fn lorem() -> usize {
813 See also [`control_brace_style`](#control_brace_style).
815 ## `force_explicit_abi`
817 Always print the abi for extern items
819 - **Default value**: `true`
820 - **Possible values**: `true`, `false`
822 **Note:** Non-"C" ABIs are always printed. If `false` then "C" is removed.
828 pub static lorem: c_int;
836 pub static lorem: c_int;
840 ## `force_format_strings`
842 Always format string literals
844 - **Default value**: `false`
845 - **Possible values**: `true`, `false`
847 See [`format_strings`](#format_strings).
849 See also [`max_width`](#max_width).
853 Format string literals where necessary
855 - **Default value**: `false`
856 - **Possible values**: `true`, `false`
861 let lorem = "ipsum dolor sit amet consectetur adipiscing elit lorem ipsum dolor sit";
868 "ipsum dolor sit amet consectetur \
869 adipiscing elit lorem ipsum dolor sit";
872 See also [`force_format_strings`](#force_format_strings), [`max_width`](#max_width).
876 Indentation of generics
878 - **Default value**: `"Block"`
879 - **Possible values**: `"Block"`, `"Visual"`
889 Adipiscing: Eq = usize,
890 Consectetur: Eq = usize,
897 adipiscing: Adipiscing,
898 consectetur: Consectetur,
908 fn lorem<Ipsum: Eq = usize,
912 Adipiscing: Eq = usize,
913 Consectetur: Eq = usize,
919 adipiscing: Adipiscing,
920 consectetur: Consectetur,
929 Use tab characters for indentation, spaces for alignment
931 - **Default value**: `false`
932 - **Possible values**: `true`, `false`
937 fn lorem() -> usize {
938 42 // spaces before 42
945 fn lorem() -> usize {
950 See also: [`tab_spaces`](#tab_spaces).
952 ## `impl_empty_single_line`
954 Put empty-body implementations on a single line
956 - **Default value**: `true`
957 - **Possible values**: `true`, `false`
972 See also [`item_brace_style`](#item_brace_style).
974 ## `indent_match_arms`
976 Indent match arms instead of keeping them at the same indentation level as the match keyword
978 - **Default value**: `true`
979 - **Possible values**: `true`, `false`
1003 See also: [`match_block_trailing_comma`](#match_block_trailing_comma), [`wrap_match_arms`](#wrap_match_arms).
1007 Indent style of imports
1009 - **Default Value**: `"Visual"`
1010 - **Possible values**: `"Block"`, `"Visual"`
1030 See also: [`imports_layout`](#imports_layout).
1034 Item layout inside a imports block
1036 - **Default value**: "Mixed"
1037 - **Possible values**: "Horizontal", "HorizontalVertical", "Mixed", "Vertical"
1042 use foo::{xxx, yyy, zzz};
1044 use foo::{aaa, bbb, ccc,
1050 **Note**: This option forces to put everything on one line and may exceeds `max_width`.
1053 use foo::{xxx, yyy, zzz};
1055 use foo::{aaa, bbb, ccc, ddd, eee, fff};
1058 #### `"HorizontalVertical"`
1061 use foo::{xxx, yyy, zzz};
1086 ## `item_brace_style`
1088 Brace style for structs and enums
1090 - **Default value**: `"SameLineWhere"`
1091 - **Possible values**: `"AlwaysNextLine"`, `"PreferSameLine"`, `"SameLineWhere"`
1093 #### `"AlwaysNextLine"`:
1108 #### `"PreferSameLine"`:
1121 #### `"SameLineWhere"`:
1135 ## `match_block_trailing_comma`
1137 Put a trailing comma after a block based match arm (non-block arms are not affected)
1139 - **Default value**: `false`
1140 - **Possible values**: `true`, `false`
1149 Lorem::Dolor => println!("dolor"),
1160 Lorem::Dolor => println!("dolor"),
1164 See also: [`indent_match_arms`](#indent_match_arms), [`trailing_comma`](#trailing_comma), [`wrap_match_arms`](#wrap_match_arms).
1166 ## `match_pattern_separator_break_point`
1168 Put a match sub-patterns' separator (`|`) in front or back.
1170 - **Default value**: `"Back"`
1171 - **Possible values**: `"Back"`, `"Front"`
1195 | Variant::Tag6 => {}
1201 Maximum width of each line
1203 - **Default value**: `100`
1204 - **Possible values**: any positive integer
1206 See also [`error_on_line_overflow`](#error_on_line_overflow).
1210 Unix or Windows line endings
1212 - **Default value**: `"Unix"`
1213 - **Possible values**: `"Native"`, `"Unix"`, `"Windows"`
1215 ## `normalize_comments`
1217 Convert /* */ comments to // comments where possible
1219 - **Default value**: `false`
1220 - **Possible values**: `true`, `false`
1226 fn dolor() -> usize {}
1229 fn adipiscing() -> usize {}
1236 fn dolor() -> usize {}
1239 fn adipiscing() -> usize {}
1242 ## `reorder_imported_names`
1244 Reorder lists of names in import statements alphabetically
1246 - **Default value**: `false`
1247 - **Possible values**: `true`, `false`
1252 use super::{lorem, ipsum, dolor, sit};
1258 use super::{dolor, ipsum, lorem, sit};
1261 See also [`reorder_imports`](#reorder_imports).
1263 ## `reorder_imports`
1265 Reorder import statements alphabetically
1267 - **Default value**: `false`
1268 - **Possible values**: `true`, `false`
1288 See also [`reorder_imported_names`](#reorder_imported_names), [`reorder_imports_in_group`](#reorder_imports_in_group).
1290 ## `reorder_imports_in_group`
1292 Reorder import statements in group
1294 - **Default value**: `false`
1295 - **Possible values**: `true`, `false`
1297 **Note:** This option takes effect only when [`reorder_imports`](#reorder_imports) is set to `true`.
1323 See also [`reorder_imports`](#reorder_imports).
1325 ## `single_line_if_else_max_width`
1327 Maximum line length for single line if-else expressions.
1329 - **Default value**: `50`
1330 - **Possible values**: any positive integer
1332 **Note:** A value of `0` results in if-else expressions being broken regardless of their line's width.
1334 #### Lines shorter than `single_line_if_else_max_width`:
1336 let lorem = if ipsum { dolor } else { sit };
1339 #### Lines longer than `single_line_if_else_max_width`:
1341 let lorem = if ipsum {
1348 See also: [`control_brace_style`](#control_brace_style).
1352 Don't reformat out of line modules
1354 - **Default value**: `false`
1355 - **Possible values**: `true`, `false`
1357 ## `space_after_bound_colon`
1359 Leave a space after the colon in a trait or lifetime bound
1361 - **Default value**: `true`
1362 - **Possible values**: `true`, `false`
1367 fn lorem<T:Eq>(t: T) {
1375 fn lorem<T: Eq>(t: T) {
1380 See also: [`space_before_bound`](#space_before_bound).
1382 ## `struct_field_align_threshold`
1384 The maximum diff of width between struct fields to be aligned with each other.
1386 - **Default value** : 0
1387 - **Possible values**: any positive integer
1409 ## `space_after_struct_lit_field_colon`
1411 Leave a space after the colon in a struct literal field
1413 - **Default value**: `true`
1414 - **Possible values**: `true`, `false`
1434 See also: [`space_before_struct_lit_field_colon`](#space_before_struct_lit_field_colon).
1436 ## `space_after_type_annotation_colon`
1438 Leave a space after the colon in a type annotation
1440 - **Default value**: `true`
1441 - **Possible values**: `true`, `false`
1446 fn lorem<T: Eq>(t:T) {
1447 let ipsum:Dolor = sit;
1454 fn lorem<T: Eq>(t: T) {
1455 let ipsum: Dolor = sit;
1459 See also: [`space_before_type_annotation`](#space_before_type_annotation).
1461 ## `space_before_bound`
1463 Leave a space before the colon in a trait or lifetime bound
1465 - **Default value**: `false`
1466 - **Possible values**: `true`, `false`
1471 fn lorem<T: Eq>(t: T) {
1472 let ipsum: Dolor = sit;
1479 fn lorem<T : Eq>(t: T) {
1480 let ipsum: Dolor = sit;
1484 See also: [`space_after_bound_colon`](#space_after_bound_colon).
1486 ## `space_before_struct_lit_field_colon`
1488 Leave a space before the colon in a struct literal field
1490 - **Default value**: `false`
1491 - **Possible values**: `true`, `false`
1511 See also: [`space_after_struct_lit_field_colon`](#space_after_struct_lit_field_colon).
1513 ## `space_before_type_annotation`
1515 Leave a space before the colon in a type annotation
1517 - **Default value**: `false`
1518 - **Possible values**: `true`, `false`
1523 fn lorem<T: Eq>(t: T) {
1524 let ipsum: Dolor = sit;
1531 fn lorem<T: Eq>(t : T) {
1532 let ipsum : Dolor = sit;
1536 See also: [`space_after_type_annotation_colon`](#space_after_type_annotation_colon).
1538 ## `spaces_around_ranges`
1540 Put spaces around the .. and ... range operators
1542 - **Default value**: `false`
1543 - **Possible values**: `true`, `false`
1554 let lorem = 0 .. 10;
1557 ## `spaces_within_angle_brackets`
1559 Put spaces within non-empty generic arguments
1561 - **Default value**: `false`
1562 - **Possible values**: `true`, `false`
1567 fn lorem<T: Eq>(t: T) {
1575 fn lorem< T: Eq >(t: T) {
1580 See also: [`spaces_within_parens`](#spaces_within_parens), [`spaces_within_square_brackets`](#spaces_within_square_brackets).
1582 ## `spaces_within_parens`
1584 Put spaces within non-empty parentheses
1586 - **Default value**: `false`
1587 - **Possible values**: `true`, `false`
1592 fn lorem<T: Eq>(t: T) {
1593 let lorem = (ipsum, dolor);
1600 fn lorem<T: Eq>( t: T ) {
1601 let lorem = ( ipsum, dolor );
1605 See also: [`spaces_within_angle_brackets`](#spaces_within_angle_brackets), [`spaces_within_square_brackets`](#spaces_within_square_brackets).
1607 ## `spaces_within_square_brackets`
1609 Put spaces within non-empty square brackets
1611 - **Default value**: `false`
1612 - **Possible values**: `true`, `false`
1617 let lorem: [usize; 2] = [ipsum, dolor];
1623 let lorem: [ usize; 2 ] = [ ipsum, dolor ];
1626 See also: [`spaces_within_parens`](#spaces_within_parens), [`spaces_within_angle_brackets`](#spaces_within_angle_brackets).
1628 ## `struct_lit_multiline_style`
1630 Multiline style on literal structs
1632 - **Default value**: `"PreferSingle"`
1633 - **Possible values**: `"ForceMulti"`, `"PreferSingle"`
1635 #### `"ForceMulti"`:
1644 #### `"PreferSingle"`:
1647 let lorem = Lorem { ipsum: dolor, sit: amet };
1650 See also: [`struct_lit_style`](#struct_lit_style), [`struct_lit_width`](#struct_lit_width).
1652 ## `struct_lit_style`
1654 Style of struct definition
1656 - **Default value**: `"Block"`
1657 - **Possible values**: `"Block"`, `"Visual"`
1671 let lorem = Lorem { ipsum: dolor,
1675 See also: [`struct_lit_multiline_style`](#struct_lit_multiline_style), [`struct_lit_style`](#struct_lit_style).
1677 ## `struct_lit_width`
1679 Maximum width in the body of a struct lit before falling back to vertical formatting
1681 - **Default value**: `18`
1682 - **Possible values**: any positive integer
1684 **Note:** A value of `0` results in vertical formatting being applied regardless of a line's width.
1686 #### Lines shorter than `struct_lit_width`:
1688 let lorem = Lorem { ipsum: dolor, sit: amet };
1691 #### Lines longer than `struct_lit_width`:
1692 See [`struct_lit_style`](#struct_lit_style).
1694 See also: [`struct_lit_multiline_style`](#struct_lit_multiline_style), [`struct_lit_style`](#struct_lit_style).
1696 ## `struct_variant_width`
1698 Maximum width in the body of a struct variant before falling back to vertical formatting
1700 - **Default value**: `35`
1701 - **Possible values**: any positive integer
1703 **Note:** A value of `0` results in vertical formatting being applied regardless of a line's width.
1705 #### Struct variants shorter than `struct_variant_width`:
1710 Sit { amet: Consectetur, adipiscing: Elit },
1714 #### Struct variants longer than `struct_variant_width`:
1728 Number of spaces per tab
1730 - **Default value**: `4`
1731 - **Possible values**: any positive integer
1737 let ipsum = dolor();
1739 "amet consectetur adipiscing elit."
1748 let ipsum = dolor();
1750 "amet consectetur adipiscing elit."
1755 See also: [`hard_tabs`](#hard_tabs).
1757 ## `take_source_hints`
1759 Retain some formatting characteristics from the source code
1761 - **Default value**: `false`
1762 - **Possible values**: `true`, `false`
1769 .dolor(|| { sit.amet().consectetur().adipiscing().elit(); });
1785 Note: This only applies if the call chain within the inner closure had already been formatted on separate lines before running rustfmt.
1789 How to handle trailing commas for lists
1791 - **Default value**: `"Vertical"`
1792 - **Possible values**: `"Always"`, `"Never"`, `"Vertical"`
1797 let Lorem { ipsum, dolor, sit, } = amet;
1811 let Lorem { ipsum, dolor, sit } = amet;
1825 let Lorem { ipsum, dolor, sit } = amet;
1836 See also: [`match_block_trailing_comma`](#match_block_trailing_comma).
1838 ## `trailing_semicolon`
1840 Add trailing semicolon after break, continue and return
1842 - **Default value**: `true`
1843 - **Possible values**: `true`, `false`
1859 ## `type_punctuation_density`
1861 Determines if `+` or `=` are wrapped in spaces in the punctuation of types
1863 - **Default value**: `"Wide"`
1864 - **Possible values**: `"Compressed"`, `"Wide"`
1866 #### `"Compressed"`:
1869 fn lorem<Ipsum: Dolor+Sit=Amet>() {
1877 fn lorem<Ipsum: Dolor + Sit = Amet>() {
1882 ## `use_try_shorthand`
1884 Replace uses of the try! macro by the ? shorthand
1886 - **Default value**: `false`
1887 - **Possible values**: `true`, `false`
1892 let lorem = try!(ipsum.map(|dolor|dolor.sit()));
1898 let lorem = ipsum.map(|dolor| dolor.sit())?;
1903 Density of a where clause.
1905 - **Default value**: `"CompressedIfEmpty"`
1906 - **Possible values**: `"Compressed"`, `"CompressedIfEmpty"`, `"Tall"`, `"Vertical"`
1908 #### `"Compressed"`:
1912 fn ipsum<Dolor>(dolor: Dolor) -> Sit
1915 fn ipsum<Dolor>(dolor: Dolor) -> Sit
1922 #### `"CompressedIfEmpty"`:
1926 fn ipsum<Dolor>(dolor: Dolor) -> Sit
1929 fn ipsum<Dolor>(dolor: Dolor) -> Sit
1942 fn ipsum<Dolor>(dolor: Dolor) -> Sit
1946 fn ipsum<Dolor>(dolor: Dolor) -> Sit
1955 **Note:** `where_density = "Tall"` currently produces the same output as `where_density = "Vertical"`.
1961 fn ipsum<Dolor>(dolor: Dolor) -> Sit
1964 fn ipsum<Dolor>(dolor: Dolor) -> Sit
1972 **Note:** `where_density = "Vertical"` currently produces the same output as `where_density = "Tall"`.
1974 See also: [`where_layout`](#where_layout), [`where_pred_indent`](#where_pred_indent), [`where_style`](#where_style).
1978 Element layout inside a where clause
1980 - **Default value**: `"Vertical"`
1981 - **Possible values**: `"Horizontal"`, `"HorizontalVertical"`, `"Mixed"`, `"Vertical"`
1983 #### `"Horizontal"`:
1986 fn lorem<Ipsum, Dolor>(ipsum: Ipsum, dolor: Dolor)
1987 where Ipsum: IpsumDolorSitAmet, Dolor: DolorSitAmetConsectetur
1992 fn lorem<Ipsum, Dolor, Sit, Amet>(ipsum: Ipsum, dolor: Dolor, sit: Sit, amet: Amet)
1993 where Ipsum: IpsumDolorSitAmet, Dolor: DolorSitAmetConsectetur, Sit: SitAmetConsecteturAdipiscing, Amet: AmetConsecteturAdipiscingElit
1999 #### `"HorizontalVertical"`:
2002 fn lorem<Ipsum, Dolor>(ipsum: Ipsum, dolor: Dolor)
2003 where Ipsum: IpsumDolorSitAmet, Dolor: DolorSitAmetConsectetur
2008 fn lorem<Ipsum, Dolor, Sit, Amet>(ipsum: Ipsum, dolor: Dolor, sit: Sit, amet: Amet)
2009 where Ipsum: IpsumDolorSitAmet,
2010 Dolor: DolorSitAmetConsectetur,
2011 Sit: SitAmetConsecteturAdipiscing,
2012 Amet: AmetConsecteturAdipiscingElit
2021 fn lorem<Ipsum, Dolor>(ipsum: Ipsum, dolor: Dolor)
2022 where Ipsum: IpsumDolorSitAmet, Dolor: DolorSitAmetConsectetur
2027 fn lorem<Ipsum, Dolor, Sit, Amet>(ipsum: Ipsum, dolor: Dolor, sit: Sit, amet: Amet)
2028 where Ipsum: IpsumDolorSitAmet, Dolor: DolorSitAmetConsectetur,
2029 Sit: SitAmetConsecteturAdipiscing, Amet: AmetConsecteturAdipiscingElit
2038 fn lorem<Ipsum, Dolor>(ipsum: Ipsum, dolor: Dolor)
2039 where Ipsum: IpsumDolorSitAmet,
2040 Dolor: DolorSitAmetConsectetur
2045 fn lorem<Ipsum, Dolor, Sit, Amet>(ipsum: Ipsum, dolor: Dolor, sit: Sit, amet: Amet)
2046 where Ipsum: IpsumDolorSitAmet,
2047 Dolor: DolorSitAmetConsectetur,
2048 Sit: SitAmetConsecteturAdipiscing,
2049 Amet: AmetConsecteturAdipiscingElit
2055 **Note**: This option only takes effect when `where_style` is set to `"Legacy"`.
2057 See also: [`where_density`](#where_density), [`where_pred_indent`](#where_pred_indent), [`where_style`](#where_style).
2059 ## `where_pred_indent`
2061 Indentation style of a where predicate
2063 - **Default value**: `"Visual"`
2064 - **Possible values**: `"Block"`, `"Visual"`
2069 fn lorem<Ipsum, Dolor, Sit, Amet>() -> T
2082 fn lorem<Ipsum, Dolor, Sit, Amet>() -> T
2092 **Note**: This option only takes effect when `where_style` is set to `"Legacy"`.
2094 See also: [`where_density`](#where_density), [`where_layout`](#where_layout), [`where_style`](#where_style).
2098 Overall strategy for where clauses
2100 - **Default value**: `"Rfc"`
2101 - **Possible values**: `"Rfc"`, `"Legacy"`
2106 fn lorem<Ipsum, Dolor, Sit, Amet>() -> T
2120 fn lorem<Ipsum, Dolor, Sit, Amet>() -> T
2130 See also: [`where_density`](#where_density), [`where_layout`](#where_layout), [`where_pred_indent`](#where_pred_indent).
2134 Break comments to fit on the line
2136 - **Default value**: `false`
2137 - **Possible values**: `true`, `false`
2142 // 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.
2148 // Lorem ipsum dolor sit amet, consectetur adipiscing elit,
2149 // sed do eiusmod tempor incididunt ut labore et dolore
2150 // magna aliqua. Ut enim ad minim veniam, quis nostrud
2151 // exercitation ullamco laboris nisi ut aliquip ex ea
2152 // commodo consequat.
2155 ## `wrap_match_arms`
2157 Wrap the body of arms in blocks when it does not fit on the same line with the pattern of arms
2159 - **Default value**: `true`
2160 - **Possible values**: `true`, `false`
2167 foooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo(x),
2168 false => println!("{}", sit),
2177 foooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo(x)
2179 false => println!("{}", sit),
2183 See also: [`indent_match_arms`](#indent_match_arms), [`match_block_trailing_comma`](#match_block_trailing_comma).
2187 What Write Mode to use when none is supplied: Replace, Overwrite, Display, Diff, Coverage
2189 - **Default value**: `"Overwrite"`
2190 - **Possible values**: `"Checkstyle"`, `"Coverage"`, `"Diff"`, `"Display"`, `"Overwrite"`, `"Plain"`, `"Replace"`