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 Unix or Windows line endings
1272 - **Default value**: `"Unix"`
1273 - **Possible values**: `"Native"`, `"Unix"`, `"Windows"`
1275 ## `normalize_comments`
1277 Convert /* */ comments to // comments where possible
1279 - **Default value**: `false`
1280 - **Possible values**: `true`, `false`
1286 fn dolor() -> usize {}
1289 fn adipiscing() -> usize {}
1296 fn dolor() -> usize {}
1299 fn adipiscing() -> usize {}
1302 ## `reorder_imported_names`
1304 Reorder lists of names in import statements alphabetically
1306 - **Default value**: `false`
1307 - **Possible values**: `true`, `false`
1312 use super::{lorem, ipsum, dolor, sit};
1318 use super::{dolor, ipsum, lorem, sit};
1321 See also [`reorder_imports`](#reorder_imports).
1323 ## `reorder_imports`
1325 Reorder import statements alphabetically
1327 - **Default value**: `false`
1328 - **Possible values**: `true`, `false`
1348 See also [`reorder_imported_names`](#reorder_imported_names), [`reorder_imports_in_group`](#reorder_imports_in_group).
1350 ## `reorder_imports_in_group`
1352 Reorder import statements in group
1354 - **Default value**: `false`
1355 - **Possible values**: `true`, `false`
1357 **Note:** This option takes effect only when [`reorder_imports`](#reorder_imports) is set to `true`.
1383 See also [`reorder_imports`](#reorder_imports).
1385 ## `single_line_if_else_max_width`
1387 Maximum line length for single line if-else expressions.
1389 - **Default value**: `50`
1390 - **Possible values**: any positive integer
1392 **Note:** A value of `0` results in if-else expressions being broken regardless of their line's width.
1394 #### Lines shorter than `single_line_if_else_max_width`:
1396 let lorem = if ipsum { dolor } else { sit };
1399 #### Lines longer than `single_line_if_else_max_width`:
1401 let lorem = if ipsum {
1408 See also: [`control_brace_style`](#control_brace_style).
1412 Don't reformat out of line modules
1414 - **Default value**: `false`
1415 - **Possible values**: `true`, `false`
1417 ## `space_after_bound_colon`
1419 Leave a space after the colon in a trait or lifetime bound
1421 - **Default value**: `true`
1422 - **Possible values**: `true`, `false`
1427 fn lorem<T:Eq>(t: T) {
1435 fn lorem<T: Eq>(t: T) {
1440 See also: [`space_before_bound`](#space_before_bound).
1442 ## `struct_field_align_threshold`
1444 The maximum diff of width between struct fields to be aligned with each other.
1446 - **Default value** : 0
1447 - **Possible values**: any positive integer
1469 ## `space_after_struct_lit_field_colon`
1471 Leave a space after the colon in a struct literal field
1473 - **Default value**: `true`
1474 - **Possible values**: `true`, `false`
1494 See also: [`space_before_struct_lit_field_colon`](#space_before_struct_lit_field_colon).
1496 ## `space_after_type_annotation_colon`
1498 Leave a space after the colon in a type annotation
1500 - **Default value**: `true`
1501 - **Possible values**: `true`, `false`
1506 fn lorem<T: Eq>(t:T) {
1507 let ipsum:Dolor = sit;
1514 fn lorem<T: Eq>(t: T) {
1515 let ipsum: Dolor = sit;
1519 See also: [`space_before_type_annotation`](#space_before_type_annotation).
1521 ## `space_before_bound`
1523 Leave a space before the colon in a trait or lifetime bound
1525 - **Default value**: `false`
1526 - **Possible values**: `true`, `false`
1531 fn lorem<T: Eq>(t: T) {
1532 let ipsum: Dolor = sit;
1539 fn lorem<T : Eq>(t: T) {
1540 let ipsum: Dolor = sit;
1544 See also: [`space_after_bound_colon`](#space_after_bound_colon).
1546 ## `space_before_struct_lit_field_colon`
1548 Leave a space before the colon in a struct literal field
1550 - **Default value**: `false`
1551 - **Possible values**: `true`, `false`
1571 See also: [`space_after_struct_lit_field_colon`](#space_after_struct_lit_field_colon).
1573 ## `space_before_type_annotation`
1575 Leave a space before the colon in a type annotation
1577 - **Default value**: `false`
1578 - **Possible values**: `true`, `false`
1583 fn lorem<T: Eq>(t: T) {
1584 let ipsum: Dolor = sit;
1591 fn lorem<T: Eq>(t : T) {
1592 let ipsum : Dolor = sit;
1596 See also: [`space_after_type_annotation_colon`](#space_after_type_annotation_colon).
1598 ## `spaces_around_ranges`
1600 Put spaces around the .. and ... range operators
1602 - **Default value**: `false`
1603 - **Possible values**: `true`, `false`
1614 let lorem = 0 .. 10;
1617 ## `spaces_within_angle_brackets`
1619 Put spaces within non-empty generic arguments
1621 - **Default value**: `false`
1622 - **Possible values**: `true`, `false`
1627 fn lorem<T: Eq>(t: T) {
1635 fn lorem< T: Eq >(t: T) {
1640 See also: [`spaces_within_parens`](#spaces_within_parens), [`spaces_within_square_brackets`](#spaces_within_square_brackets).
1642 ## `spaces_within_parens`
1644 Put spaces within non-empty parentheses
1646 - **Default value**: `false`
1647 - **Possible values**: `true`, `false`
1652 fn lorem<T: Eq>(t: T) {
1653 let lorem = (ipsum, dolor);
1660 fn lorem<T: Eq>( t: T ) {
1661 let lorem = ( ipsum, dolor );
1665 See also: [`spaces_within_angle_brackets`](#spaces_within_angle_brackets), [`spaces_within_square_brackets`](#spaces_within_square_brackets).
1667 ## `spaces_within_square_brackets`
1669 Put spaces within non-empty square brackets
1671 - **Default value**: `false`
1672 - **Possible values**: `true`, `false`
1677 let lorem: [usize; 2] = [ipsum, dolor];
1683 let lorem: [ usize; 2 ] = [ ipsum, dolor ];
1686 See also: [`spaces_within_parens`](#spaces_within_parens), [`spaces_within_angle_brackets`](#spaces_within_angle_brackets).
1688 ## `struct_lit_multiline_style`
1690 Multiline style on literal structs
1692 - **Default value**: `"PreferSingle"`
1693 - **Possible values**: `"ForceMulti"`, `"PreferSingle"`
1695 #### `"ForceMulti"`:
1704 #### `"PreferSingle"`:
1707 let lorem = Lorem { ipsum: dolor, sit: amet };
1710 See also: [`struct_lit_style`](#struct_lit_style), [`struct_lit_width`](#struct_lit_width).
1712 ## `struct_lit_style`
1714 Style of struct definition
1716 - **Default value**: `"Block"`
1717 - **Possible values**: `"Block"`, `"Visual"`
1731 let lorem = Lorem { ipsum: dolor,
1735 See also: [`struct_lit_multiline_style`](#struct_lit_multiline_style), [`struct_lit_style`](#struct_lit_style).
1737 ## `struct_lit_width`
1739 Maximum width in the body of a struct lit before falling back to vertical formatting
1741 - **Default value**: `18`
1742 - **Possible values**: any positive integer
1744 **Note:** A value of `0` results in vertical formatting being applied regardless of a line's width.
1746 #### Lines shorter than `struct_lit_width`:
1748 let lorem = Lorem { ipsum: dolor, sit: amet };
1751 #### Lines longer than `struct_lit_width`:
1752 See [`struct_lit_style`](#struct_lit_style).
1754 See also: [`struct_lit_multiline_style`](#struct_lit_multiline_style), [`struct_lit_style`](#struct_lit_style).
1756 ## `struct_variant_width`
1758 Maximum width in the body of a struct variant before falling back to vertical formatting
1760 - **Default value**: `35`
1761 - **Possible values**: any positive integer
1763 **Note:** A value of `0` results in vertical formatting being applied regardless of a line's width.
1765 #### Struct variants shorter than `struct_variant_width`:
1770 Sit { amet: Consectetur, adipiscing: Elit },
1774 #### Struct variants longer than `struct_variant_width`:
1788 Number of spaces per tab
1790 - **Default value**: `4`
1791 - **Possible values**: any positive integer
1797 let ipsum = dolor();
1799 "amet consectetur adipiscing elit."
1808 let ipsum = dolor();
1810 "amet consectetur adipiscing elit."
1815 See also: [`hard_tabs`](#hard_tabs).
1817 ## `take_source_hints`
1819 Retain some formatting characteristics from the source code
1821 - **Default value**: `false`
1822 - **Possible values**: `true`, `false`
1829 .dolor(|| { sit.amet().consectetur().adipiscing().elit(); });
1845 Note: This only applies if the call chain within the inner closure had already been formatted on separate lines before running rustfmt.
1849 How to handle trailing commas for lists
1851 - **Default value**: `"Vertical"`
1852 - **Possible values**: `"Always"`, `"Never"`, `"Vertical"`
1857 let Lorem { ipsum, dolor, sit, } = amet;
1871 let Lorem { ipsum, dolor, sit } = amet;
1885 let Lorem { ipsum, dolor, sit } = amet;
1896 See also: [`match_block_trailing_comma`](#match_block_trailing_comma).
1898 ## `trailing_semicolon`
1900 Add trailing semicolon after break, continue and return
1902 - **Default value**: `true`
1903 - **Possible values**: `true`, `false`
1919 ## `type_punctuation_density`
1921 Determines if `+` or `=` are wrapped in spaces in the punctuation of types
1923 - **Default value**: `"Wide"`
1924 - **Possible values**: `"Compressed"`, `"Wide"`
1926 #### `"Compressed"`:
1929 fn lorem<Ipsum: Dolor+Sit=Amet>() {
1937 fn lorem<Ipsum: Dolor + Sit = Amet>() {
1942 ## `use_try_shorthand`
1944 Replace uses of the try! macro by the ? shorthand
1946 - **Default value**: `false`
1947 - **Possible values**: `true`, `false`
1952 let lorem = try!(ipsum.map(|dolor|dolor.sit()));
1958 let lorem = ipsum.map(|dolor| dolor.sit())?;
1963 Density of a where clause.
1965 - **Default value**: `"CompressedIfEmpty"`
1966 - **Possible values**: `"Compressed"`, `"CompressedIfEmpty"`, `"Tall"`, `"Vertical"`
1968 #### `"Compressed"`:
1972 fn ipsum<Dolor>(dolor: Dolor) -> Sit
1975 fn ipsum<Dolor>(dolor: Dolor) -> Sit
1982 #### `"CompressedIfEmpty"`:
1986 fn ipsum<Dolor>(dolor: Dolor) -> Sit
1989 fn ipsum<Dolor>(dolor: Dolor) -> Sit
2002 fn ipsum<Dolor>(dolor: Dolor) -> Sit
2006 fn ipsum<Dolor>(dolor: Dolor) -> Sit
2015 **Note:** `where_density = "Tall"` currently produces the same output as `where_density = "Vertical"`.
2021 fn ipsum<Dolor>(dolor: Dolor) -> Sit
2024 fn ipsum<Dolor>(dolor: Dolor) -> Sit
2032 **Note:** `where_density = "Vertical"` currently produces the same output as `where_density = "Tall"`.
2034 See also: [`where_layout`](#where_layout), [`where_pred_indent`](#where_pred_indent), [`where_style`](#where_style).
2038 Element layout inside a where clause
2040 - **Default value**: `"Vertical"`
2041 - **Possible values**: `"Horizontal"`, `"HorizontalVertical"`, `"Mixed"`, `"Vertical"`
2043 #### `"Horizontal"`:
2046 fn lorem<Ipsum, Dolor>(ipsum: Ipsum, dolor: Dolor)
2047 where Ipsum: IpsumDolorSitAmet, Dolor: DolorSitAmetConsectetur
2052 fn lorem<Ipsum, Dolor, Sit, Amet>(ipsum: Ipsum, dolor: Dolor, sit: Sit, amet: Amet)
2053 where Ipsum: IpsumDolorSitAmet, Dolor: DolorSitAmetConsectetur, Sit: SitAmetConsecteturAdipiscing, Amet: AmetConsecteturAdipiscingElit
2059 #### `"HorizontalVertical"`:
2062 fn lorem<Ipsum, Dolor>(ipsum: Ipsum, dolor: Dolor)
2063 where Ipsum: IpsumDolorSitAmet, Dolor: DolorSitAmetConsectetur
2068 fn lorem<Ipsum, Dolor, Sit, Amet>(ipsum: Ipsum, dolor: Dolor, sit: Sit, amet: Amet)
2069 where Ipsum: IpsumDolorSitAmet,
2070 Dolor: DolorSitAmetConsectetur,
2071 Sit: SitAmetConsecteturAdipiscing,
2072 Amet: AmetConsecteturAdipiscingElit
2081 fn lorem<Ipsum, Dolor>(ipsum: Ipsum, dolor: Dolor)
2082 where Ipsum: IpsumDolorSitAmet, Dolor: DolorSitAmetConsectetur
2087 fn lorem<Ipsum, Dolor, Sit, Amet>(ipsum: Ipsum, dolor: Dolor, sit: Sit, amet: Amet)
2088 where Ipsum: IpsumDolorSitAmet, Dolor: DolorSitAmetConsectetur,
2089 Sit: SitAmetConsecteturAdipiscing, Amet: AmetConsecteturAdipiscingElit
2098 fn lorem<Ipsum, Dolor>(ipsum: Ipsum, dolor: Dolor)
2099 where Ipsum: IpsumDolorSitAmet,
2100 Dolor: DolorSitAmetConsectetur
2105 fn lorem<Ipsum, Dolor, Sit, Amet>(ipsum: Ipsum, dolor: Dolor, sit: Sit, amet: Amet)
2106 where Ipsum: IpsumDolorSitAmet,
2107 Dolor: DolorSitAmetConsectetur,
2108 Sit: SitAmetConsecteturAdipiscing,
2109 Amet: AmetConsecteturAdipiscingElit
2115 **Note**: This option only takes effect when `where_style` is set to `"Legacy"`.
2117 See also: [`where_density`](#where_density), [`where_pred_indent`](#where_pred_indent), [`where_style`](#where_style).
2119 ## `where_pred_indent`
2121 Indentation style of a where predicate
2123 - **Default value**: `"Visual"`
2124 - **Possible values**: `"Block"`, `"Visual"`
2129 fn lorem<Ipsum, Dolor, Sit, Amet>() -> T
2142 fn lorem<Ipsum, Dolor, Sit, Amet>() -> T
2152 **Note**: This option only takes effect when `where_style` is set to `"Legacy"`.
2154 See also: [`where_density`](#where_density), [`where_layout`](#where_layout), [`where_style`](#where_style).
2158 Overall strategy for where clauses
2160 - **Default value**: `"Rfc"`
2161 - **Possible values**: `"Rfc"`, `"Legacy"`
2166 fn lorem<Ipsum, Dolor, Sit, Amet>() -> T
2180 fn lorem<Ipsum, Dolor, Sit, Amet>() -> T
2190 See also: [`where_density`](#where_density), [`where_layout`](#where_layout), [`where_pred_indent`](#where_pred_indent).
2194 Break comments to fit on the line
2196 - **Default value**: `false`
2197 - **Possible values**: `true`, `false`
2202 // 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.
2208 // Lorem ipsum dolor sit amet, consectetur adipiscing elit,
2209 // sed do eiusmod tempor incididunt ut labore et dolore
2210 // magna aliqua. Ut enim ad minim veniam, quis nostrud
2211 // exercitation ullamco laboris nisi ut aliquip ex ea
2212 // commodo consequat.
2215 ## `wrap_match_arms`
2217 Wrap the body of arms in blocks when it does not fit on the same line with the pattern of arms
2219 - **Default value**: `true`
2220 - **Possible values**: `true`, `false`
2227 foooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo(x),
2228 false => println!("{}", sit),
2237 foooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo(x)
2239 false => println!("{}", sit),
2243 See also: [`indent_match_arms`](#indent_match_arms), [`match_block_trailing_comma`](#match_block_trailing_comma).
2247 What Write Mode to use when none is supplied: Replace, Overwrite, Display, Diff, Coverage
2249 - **Default value**: `"Overwrite"`
2250 - **Possible values**: `"Checkstyle"`, `"Coverage"`, `"Diff"`, `"Display"`, `"Overwrite"`, `"Plain"`, `"Replace"`