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 [`indent_style`](#indent_style) 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.
55 Indent on expressions or items.
57 - **Default value**: `"Block"`
58 - **Possible values**: `"Block"`, `"Visual"`
62 #### `"Block"` (default):
79 let lorem = vec!["ipsum",
90 #### `"Block"` (default):
111 See also: [`control_brace_style`](#control_brace_style).
113 ### Function arguments
115 #### `"Block"` (default):
120 fn lorem(ipsum: usize) {}
140 fn lorem(ipsum: usize) {}
142 fn lorem(ipsum: usize,
155 #### `"Block"` (default):
185 #### `"Block"` (default):
193 Adipiscing: Eq = usize,
194 Consectetur: Eq = usize,
201 adipiscing: Adipiscing,
202 consectetur: Consectetur,
212 fn lorem<Ipsum: Eq = usize,
216 Adipiscing: Eq = usize,
217 Consectetur: Eq = usize,
223 adipiscing: Adipiscing,
224 consectetur: Consectetur,
233 #### `"Block"` (default):
245 let lorem = Lorem { ipsum: dolor,
249 See also: [`struct_lit_multiline_style`](#struct_lit_multiline_style), [`indent_style`](#indent_style).
253 #### `"Block"` (default):
256 fn lorem<Ipsum, Dolor, Sit, Amet>() -> T
270 fn lorem<Ipsum, Dolor, Sit, Amet>() -> T
280 See also: [`where_density`](#where_density), [`where_layout`](#where_layout).
284 Maximum width of an array literal before falling back to vertical formatting
286 - **Default value**: `60`
287 - **Possible values**: any positive integer
289 **Note:** A value of `0` results in [`indent_style`](#indent_style) being applied regardless of a line's width.
291 #### Lines shorter than `array_width`:
293 let lorem = vec!["ipsum", "dolor", "sit", "amet", "consectetur", "adipiscing", "elit"];
296 #### Lines longer than `array_width`:
297 See [`indent_style`](#indent_style).
299 ## `attributes_on_same_line_as_field`
301 Try to put attributes on the same line as fields
303 - **Default value**: `true`
304 - **Possible values**: `true`, `false`
306 #### `true` (default):
310 #[serde(rename = "Ipsum")] ipsum: usize,
311 #[serde(rename = "Dolor")] dolor: usize,
312 #[serde(rename = "Amet")] amet: usize,
320 #[serde(rename = "Ipsum")]
322 #[serde(rename = "Dolor")]
324 #[serde(rename = "Amet")]
329 ## `attributes_on_same_line_as_variant`
331 Try to put attributes on the same line as variants
333 - **Default value**: `true`
334 - **Possible values**: `true`, `false`
336 #### `true` (default):
340 #[serde(skip_serializing)] Ipsum,
341 #[serde(skip_serializing)] Dolor,
342 #[serde(skip_serializing)] Amet,
350 #[serde(skip_serializing)]
352 #[serde(skip_serializing)]
354 #[serde(skip_serializing)]
361 Where to put a binary operator when a binary expression goes multiline.
363 - **Default value**: `"Front"`
364 - **Possible values**: `"Front"`, `"Back"`
366 #### `"Front"` (default):
377 let range = aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
378 ..bbbbbbbbbbbbbbbbbbbbbbbbbbbbb;
392 let range = aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa..
393 bbbbbbbbbbbbbbbbbbbbbbbbbbbbb;
400 - **Default value**: `"Block"`
401 - **Possible values**: `"Block"`, `"Visual"`
403 #### `"Block"` (default):
418 let lorem = ipsum.dolor()
426 See also [`chain_width`](#chain_width).
430 Maximum length of a chain to fit on a single line
432 - **Default value**: `60`
433 - **Possible values**: any positive integer
435 #### Lines shorter than `chain_width`:
437 let lorem = ipsum.dolor().sit().amet().consectetur().adipiscing().elit();
440 #### Lines longer than `chain_width`:
441 See [`chain_indent`](#chain_indent).
443 ## `chain_split_single_child`
445 Split a chain with a single child if its length exceeds [`chain_width`](#chain_width).
447 - **Default value**: `false`
448 - **Possible values**: `false`, `true`
450 #### `false` (default):
453 let files = fs::read_dir("tests/coverage/source").expect("Couldn't read source dir");
459 let files = fs::read_dir("tests/coverage/source")
460 .expect("Couldn't read source dir");
463 See also [`chain_width`](#chain_width).
465 ## `combine_control_expr`
467 Combine control expressions with function calls.
469 - **Default value**: `true`
470 - **Possible values**: `true`, `false`
472 #### `true` (default):
484 foo!(if let Some(..) = x {
497 foo!(while let Some(..) = x {
531 if let Some(..) = x {
548 while let Some(..) = x {
574 Maximum length of comments. No effect unless`wrap_comments = true`.
576 - **Default value**: `80`
577 - **Possible values**: any positive integer
579 **Note:** A value of `0` results in [`wrap_comments`](#wrap_comments) being applied regardless of a line's width.
581 #### Comments shorter than `comment_width`:
583 // Lorem ipsum dolor sit amet, consectetur adipiscing elit.
586 #### Comments longer than `comment_width`:
588 // Lorem ipsum dolor sit amet,
589 // consectetur adipiscing elit.
592 See also [`wrap_comments`](#wrap_comments).
594 ## `condense_wildcard_suffixes`
596 Replace strings of _ wildcards by a single .. in tuple patterns
598 - **Default value**: `false`
599 - **Possible values**: `true`, `false`
601 #### `false` (default):
604 let (lorem, ipsum, _, _) = (1, 2, 3, 4);
610 let (lorem, ipsum, ..) = (1, 2, 3, 4);
613 ## `control_brace_style`
615 Brace style for control flow constructs
617 - **Default value**: `"AlwaysSameLine"`
618 - **Possible values**: `"AlwaysNextLine"`, `"AlwaysSameLine"`, `"ClosingNextLine"`
620 #### `"AlwaysSameLine"` (default):
630 #### `"AlwaysNextLine"`:
643 #### `"ClosingNextLine"`:
654 ## `disable_all_formatting`
656 Don't reformat anything
658 - **Default value**: `false`
659 - **Possible values**: `true`, `false`
661 ## `error_on_line_overflow`
663 Error if unable to get all lines within `max_width`
665 - **Default value**: `true`
666 - **Possible values**: `true`, `false`
668 See also [`max_width`](#max_width).
670 ## `error_on_line_overflow_comments`
672 Error if unable to get all comment lines within `comment_width`.
674 - **Default value**: `true`
675 - **Possible values**: `true`, `false`
677 See also [`comment_width`](#comment_width).
681 Argument density in functions
683 - **Default value**: `"Tall"`
684 - **Possible values**: `"Compressed"`, `"CompressedIfEmpty"`, `"Tall"`, `"Vertical"`
686 #### `"Tall"` (default):
690 fn lorem(ipsum: Ipsum, dolor: Dolor, sit: Sit, amet: Amet);
692 fn lorem(ipsum: Ipsum, dolor: Dolor, sit: Sit, amet: Amet) {
701 consectetur: Consectetur,
702 adipiscing: Adipiscing,
711 consectetur: Consectetur,
712 adipiscing: Adipiscing,
724 fn lorem(ipsum: Ipsum, dolor: Dolor, sit: Sit, amet: Amet);
726 fn lorem(ipsum: Ipsum, dolor: Dolor, sit: Sit, amet: Amet) {
731 ipsum: Ipsum, dolor: Dolor, sit: Sit, amet: Amet, consectetur: Consectetur,
732 adipiscing: Adipiscing, elit: Elit,
736 ipsum: Ipsum, dolor: Dolor, sit: Sit, amet: Amet, consectetur: Consectetur,
737 adipiscing: Adipiscing, elit: Elit,
744 #### `"CompressedIfEmpty"`:
748 fn lorem(ipsum: Ipsum, dolor: Dolor, sit: Sit, amet: Amet);
750 fn lorem(ipsum: Ipsum, dolor: Dolor, sit: Sit, amet: Amet) {
755 ipsum: Ipsum, dolor: Dolor, sit: Sit, amet: Amet, consectetur: Consectetur,
756 adipiscing: Adipiscing, elit: Elit,
764 consectetur: Consectetur,
765 adipiscing: Adipiscing,
777 fn lorem(ipsum: Ipsum,
782 fn lorem(ipsum: Ipsum,
789 fn lorem(ipsum: Ipsum,
793 consectetur: Consectetur,
794 adipiscing: Adipiscing,
797 fn lorem(ipsum: Ipsum,
801 consectetur: Consectetur,
802 adipiscing: Adipiscing,
812 Brace style for items
814 - **Default value**: `"SameLineWhere"`
815 - **Possible values**: `"AlwaysNextLine"`, `"PreferSameLine"`, `"SameLineWhere"`
819 #### `"SameLineWhere"` (default):
826 fn lorem(ipsum: usize) {
830 fn lorem<T>(ipsum: T)
832 T: Add + Sub + Mul + Div,
838 #### `"AlwaysNextLine"`:
846 fn lorem(ipsum: usize)
851 fn lorem<T>(ipsum: T)
853 T: Add + Sub + Mul + Div,
859 #### `"PreferSameLine"`:
866 fn lorem(ipsum: usize) {
870 fn lorem<T>(ipsum: T)
872 T: Add + Sub + Mul + Div, {
877 ### Structs and enums
879 #### `"SameLineWhere"` (default):
893 #### `"AlwaysNextLine"`:
908 #### `"PreferSameLine"`:
923 Maximum width of the args of a function call before falling back to vertical formatting
925 - **Default value**: `60`
926 - **Possible values**: any positive integer
928 **Note:** A value of `0` results in vertical formatting being applied regardless of a line's width.
930 #### Function call shorter than `fn_call_width`:
932 lorem("lorem", "ipsum", "dolor", "sit", "amet", "consectetur", "adipiscing", "elit");
935 #### Function call longer than `fn_call_width`:
937 See [`indent_style`](#indent_style).
939 ## `fn_empty_single_line`
941 Put empty-body functions on a single line
943 - **Default value**: `true`
944 - **Possible values**: `true`, `false`
946 #### `true` (default):
959 See also [`control_brace_style`](#control_brace_style).
964 Put single-expression functions on a single line
966 - **Default value**: `false`
967 - **Possible values**: `true`, `false`
969 #### `false` (default):
972 fn lorem() -> usize {
976 fn lorem() -> usize {
985 fn lorem() -> usize { 42 }
987 fn lorem() -> usize {
993 See also [`control_brace_style`](#control_brace_style).
995 ## `force_explicit_abi`
997 Always print the abi for extern items
999 - **Default value**: `true`
1000 - **Possible values**: `true`, `false`
1002 **Note:** Non-"C" ABIs are always printed. If `false` then "C" is removed.
1004 #### `true` (default):
1008 pub static lorem: c_int;
1016 pub static lorem: c_int;
1022 Format string literals where necessary
1024 - **Default value**: `false`
1025 - **Possible values**: `true`, `false`
1027 #### `false` (default):
1030 let lorem = "ipsum dolor sit amet consectetur adipiscing elit lorem ipsum dolor sit";
1037 "ipsum dolor sit amet consectetur \
1038 adipiscing elit lorem ipsum dolor sit";
1041 See also [`max_width`](#max_width).
1045 Use tab characters for indentation, spaces for alignment
1047 - **Default value**: `false`
1048 - **Possible values**: `true`, `false`
1050 #### `false` (default):
1053 fn lorem() -> usize {
1054 42 // spaces before 42
1061 fn lorem() -> usize {
1062 42 // tabs before 42
1066 See also: [`tab_spaces`](#tab_spaces).
1068 ## `impl_empty_single_line`
1070 Put empty-body implementations on a single line
1072 - **Default value**: `true`
1073 - **Possible values**: `true`, `false`
1075 #### `true` (default):
1088 See also [`brace_style`](#brace_style).
1090 ## `indent_match_arms`
1092 Indent match arms instead of keeping them at the same indentation level as the match keyword
1094 - **Default value**: `true`
1095 - **Possible values**: `true`, `false`
1097 #### `true` (default):
1119 See also: [`match_block_trailing_comma`](#match_block_trailing_comma), [`wrap_match_arms`](#wrap_match_arms).
1123 Indent style of imports
1125 - **Default Value**: `"Visual"`
1126 - **Possible values**: `"Block"`, `"Visual"`
1128 #### `"Visual"` (default):
1146 See also: [`imports_layout`](#imports_layout).
1150 Item layout inside a imports block
1152 - **Default value**: "Mixed"
1153 - **Possible values**: "Horizontal", "HorizontalVertical", "Mixed", "Vertical"
1155 #### `"Mixed"` (default):
1158 use foo::{xxx, yyy, zzz};
1160 use foo::{aaa, bbb, ccc,
1164 #### `"Horizontal"`:
1166 **Note**: This option forces to put everything on one line and may exceeds `max_width`.
1169 use foo::{xxx, yyy, zzz};
1171 use foo::{aaa, bbb, ccc, ddd, eee, fff};
1174 #### `"HorizontalVertical"`:
1177 use foo::{xxx, yyy, zzz};
1202 ## `match_arm_forces_newline`
1204 Consistently put match arms (block based or not) in a newline.
1206 - **Default value**: `false`
1207 - **Possible values**: `true`, `false`
1209 #### `false` (default):
1213 // a non-empty block
1220 X2 => println!("ok"),
1228 // a non-empty block
1242 See also: [`wrap_match_arms`](#wrap_match_arms).
1244 ## `match_block_trailing_comma`
1246 Put a trailing comma after a block based match arm (non-block arms are not affected)
1248 - **Default value**: `false`
1249 - **Possible values**: `true`, `false`
1251 #### `false` (default):
1258 Lorem::Dolor => println!("dolor"),
1269 Lorem::Dolor => println!("dolor"),
1273 See also: [`indent_match_arms`](#indent_match_arms), [`trailing_comma`](#trailing_comma), [`wrap_match_arms`](#wrap_match_arms).
1277 Maximum width of each line
1279 - **Default value**: `100`
1280 - **Possible values**: any positive integer
1282 See also [`error_on_line_overflow`](#error_on_line_overflow).
1286 Merge multiple derives into a single one.
1288 - **Default value**: `true`
1289 - **Possible values**: `true`, `false`
1291 #### `true` (default):
1294 #[derive(Eq, PartialEq, Debug, Copy, Clone)]
1301 #[derive(Eq, PartialEq)]
1303 #[derive(Copy, Clone)]
1307 ## `multiline_closure_forces_block`
1309 Force multiline closure bodies to be wrapped in a block
1311 - **Default value**: `false`
1312 - **Possible values**: `false`, `true`
1314 #### `false` (default):
1317 result.and_then(|maybe_value| match maybe_value {
1327 result.and_then(|maybe_value| {
1335 ## `multiline_match_arm_forces_block`
1337 Force multiline match arm bodies to be wrapped in a block
1339 - **Default value**: `false`
1340 - **Possible values**: `false`, `true`
1342 #### `false` (default):
1347 println!("Hello World");
1359 println!("Hello World");
1368 Unix or Windows line endings
1370 - **Default value**: `"Unix"`
1371 - **Possible values**: `"Native"`, `"Unix"`, `"Windows"`
1373 ## `normalize_comments`
1375 Convert /* */ comments to // comments where possible
1377 - **Default value**: `false`
1378 - **Possible values**: `true`, `false`
1380 #### `false` (default):
1384 fn dolor() -> usize {}
1387 fn adipiscing() -> usize {}
1394 fn dolor() -> usize {}
1397 fn adipiscing() -> usize {}
1400 ## `reorder_imported_names`
1402 Reorder lists of names in import statements alphabetically
1404 - **Default value**: `false`
1405 - **Possible values**: `true`, `false`
1407 #### `false` (default):
1410 use super::{lorem, ipsum, dolor, sit};
1416 use super::{dolor, ipsum, lorem, sit};
1419 See also [`reorder_imports`](#reorder_imports).
1421 ## `reorder_imports`
1423 Reorder import statements alphabetically
1425 - **Default value**: `false`
1426 - **Possible values**: `true`, `false`
1428 #### `false` (default):
1446 See also [`reorder_imported_names`](#reorder_imported_names), [`reorder_imports_in_group`](#reorder_imports_in_group).
1448 ## `reorder_imports_in_group`
1450 Reorder import statements in group
1452 - **Default value**: `false`
1453 - **Possible values**: `true`, `false`
1455 **Note:** This option takes effect only when [`reorder_imports`](#reorder_imports) is set to `true`.
1457 #### `false` (default):
1481 See also [`reorder_imports`](#reorder_imports).
1483 ## `reorder_extern_crates`
1485 Reorder `extern crate` statements alphabetically
1487 - **Default value**: `true`
1488 - **Possible values**: `true`, `false`
1490 #### `true` (default):
1508 See also [`reorder_extern_crates_in_group`](#reorder_extern_crates_in_group).
1510 ## `reorder_extern_crates_in_group`
1512 Reorder `extern crate` statements in group
1514 - **Default value**: `true`
1515 - **Possible values**: `true`, `false`
1517 **Note:** This option takes effect only when [`reorder_imports`](#reorder_imports) is set to `true`.
1519 #### `true` (default):
1543 See also [`reorder_extern_crates`](#reorder_extern_crates).
1547 Report `TODO` items in comments.
1549 - **Default value**: `"Never"`
1550 - **Possible values**: `"Always"`, `"Unnumbered"`, `"Never"`
1552 Warns about any comments containing `TODO` in them when set to `"Always"`. If
1553 it contains a `#X` (with `X` being a number) in parentheses following the
1554 `TODO`, `"Unnumbered"` will ignore it.
1556 See also [`report_fixme`](#report_fixme).
1560 Report `FIXME` items in comments.
1562 - **Default value**: `"Never"`
1563 - **Possible values**: `"Always"`, `"Unnumbered"`, `"Never"`
1565 Warns about any comments containing `FIXME` in them when set to `"Always"`. If
1566 it contains a `#X` (with `X` being a number) in parentheses following the
1567 `FIXME`, `"Unnumbered"` will ignore it.
1569 See also [`report_todo`](#report_todo).
1571 ## `single_line_if_else_max_width`
1573 Maximum line length for single line if-else expressions.
1575 - **Default value**: `50`
1576 - **Possible values**: any positive integer
1578 **Note:** A value of `0` results in if-else expressions being broken regardless of their line's width.
1580 #### Lines shorter than `single_line_if_else_max_width`:
1582 let lorem = if ipsum { dolor } else { sit };
1585 #### Lines longer than `single_line_if_else_max_width`:
1587 let lorem = if ipsum {
1594 See also: [`control_brace_style`](#control_brace_style).
1598 Don't reformat out of line modules
1600 - **Default value**: `false`
1601 - **Possible values**: `true`, `false`
1603 ## `space_after_colon`
1605 Leave a space after the colon.
1607 - **Default value**: `true`
1608 - **Possible values**: `true`, `false`
1610 #### `true` (default):
1613 fn lorem<T: Eq>(t: T) {
1614 let lorem: Dolor = Lorem {
1624 fn lorem<T:Eq>(t:T) {
1625 let lorem:Dolor = Lorem {
1632 See also: [`space_before_colon`](#space_before_colon).
1634 ## `space_before_colon`
1636 Leave a space before the colon.
1638 - **Default value**: `false`
1639 - **Possible values**: `true`, `false`
1641 #### `false` (default):
1644 fn lorem<T: Eq>(t: T) {
1645 let lorem: Dolor = Lorem {
1655 fn lorem<T : Eq>(t : T) {
1656 let lorem : Dolor = Lorem {
1663 See also: [`space_after_colon`](#space_after_colon).
1665 ## `struct_field_align_threshold`
1667 The maximum diff of width between struct fields to be aligned with each other.
1669 - **Default value** : 0
1670 - **Possible values**: any positive integer
1694 ## `spaces_around_ranges`
1696 Put spaces around the .. and ... range operators
1698 - **Default value**: `false`
1699 - **Possible values**: `true`, `false`
1701 #### `false` (default):
1710 let lorem = 0 .. 10;
1713 ## `spaces_within_parens_and_brackets`
1715 Put spaces within non-empty generic arguments
1717 - **Default value**: `false`
1718 - **Possible values**: `true`, `false`
1720 #### `false` (default):
1723 fn lorem<T: Eq>(t: T) {
1731 fn lorem< T: Eq >(t: T) {
1736 See also: [`spaces_within_parens_and_brackets`](#spaces_within_parens_and_brackets), [`spaces_within_parens_and_brackets`](#spaces_within_parens_and_brackets).
1738 ## `spaces_within_parens_and_brackets`
1740 Put spaces within non-empty parentheses
1742 - **Default value**: `false`
1743 - **Possible values**: `true`, `false`
1745 #### `false` (default):
1748 fn lorem<T: Eq>(t: T) {
1749 let lorem = (ipsum, dolor);
1756 fn lorem<T: Eq>( t: T ) {
1757 let lorem = ( ipsum, dolor );
1761 See also: [`spaces_within_parens_and_brackets`](#spaces_within_parens_and_brackets), [`spaces_within_parens_and_brackets`](#spaces_within_parens_and_brackets).
1763 ## `spaces_within_parens_and_brackets`
1765 Put spaces within non-empty square brackets
1767 - **Default value**: `false`
1768 - **Possible values**: `true`, `false`
1770 #### `false` (default):
1773 let lorem: [usize; 2] = [ipsum, dolor];
1779 let lorem: [ usize; 2 ] = [ ipsum, dolor ];
1782 See also: [`spaces_within_parens_and_brackets`](#spaces_within_parens_and_brackets), [`spaces_within_parens_and_brackets`](#spaces_within_parens_and_brackets).
1784 ## `struct_lit_multiline_style`
1786 Multiline style on literal structs
1788 - **Default value**: `"PreferSingle"`
1789 - **Possible values**: `"ForceMulti"`, `"PreferSingle"`
1791 #### `"PreferSingle"` (default):
1794 let lorem = Lorem { ipsum: dolor, sit: amet };
1797 #### `"ForceMulti"`:
1806 See also: [`indent_style`](#indent_style), [`struct_lit_width`](#struct_lit_width).
1808 ## `struct_lit_width`
1810 Maximum width in the body of a struct lit before falling back to vertical formatting
1812 - **Default value**: `18`
1813 - **Possible values**: any positive integer
1815 **Note:** A value of `0` results in vertical formatting being applied regardless of a line's width.
1817 #### Lines shorter than `struct_lit_width`:
1819 let lorem = Lorem { ipsum: dolor, sit: amet };
1822 #### Lines longer than `struct_lit_width`:
1823 See [`indent_style`](#indent_style).
1825 See also: [`struct_lit_multiline_style`](#struct_lit_multiline_style), [`indent_style`](#indent_style).
1827 ## `struct_variant_width`
1829 Maximum width in the body of a struct variant before falling back to vertical formatting
1831 - **Default value**: `35`
1832 - **Possible values**: any positive integer
1834 **Note:** A value of `0` results in vertical formatting being applied regardless of a line's width.
1836 #### Struct variants shorter than `struct_variant_width`:
1841 Sit { amet: Consectetur, adipiscing: Elit },
1845 #### Struct variants longer than `struct_variant_width`:
1859 Number of spaces per tab
1861 - **Default value**: `4`
1862 - **Possible values**: any positive integer
1868 let ipsum = dolor();
1870 "amet consectetur adipiscing elit."
1879 let ipsum = dolor();
1881 "amet consectetur adipiscing elit."
1886 See also: [`hard_tabs`](#hard_tabs).
1891 How to handle trailing commas for lists
1893 - **Default value**: `"Vertical"`
1894 - **Possible values**: `"Always"`, `"Never"`, `"Vertical"`
1896 #### `"Vertical"` (default):
1899 let Lorem { ipsum, dolor, sit } = amet;
1913 let Lorem { ipsum, dolor, sit, } = amet;
1927 let Lorem { ipsum, dolor, sit } = amet;
1938 See also: [`match_block_trailing_comma`](#match_block_trailing_comma).
1940 ## `trailing_semicolon`
1942 Add trailing semicolon after break, continue and return
1944 - **Default value**: `true`
1945 - **Possible values**: `true`, `false`
1947 #### `true` (default):
1961 ## `type_punctuation_density`
1963 Determines if `+` or `=` are wrapped in spaces in the punctuation of types
1965 - **Default value**: `"Wide"`
1966 - **Possible values**: `"Compressed"`, `"Wide"`
1968 #### `"Wide"` (default):
1971 fn lorem<Ipsum: Dolor + Sit = Amet>() {
1976 #### `"Compressed"`:
1979 fn lorem<Ipsum: Dolor+Sit=Amet>() {
1984 ## `use_try_shorthand`
1986 Replace uses of the try! macro by the ? shorthand
1988 - **Default value**: `false`
1989 - **Possible values**: `true`, `false`
1991 #### `false` (default):
1994 let lorem = try!(ipsum.map(|dolor|dolor.sit()));
2000 let lorem = ipsum.map(|dolor| dolor.sit())?;
2005 Density of a where clause.
2007 - **Default value**: `"Vertical"`
2008 - **Possible values**: `"Compressed"`, `"CompressedIfEmpty"`, `"Tall"`, `"Vertical"`
2010 #### `"Vertical"` (default):
2014 fn ipsum<Dolor>(dolor: Dolor) -> Sit
2018 fn ipsum<Dolor>(dolor: Dolor) -> Sit
2027 **Note:** `where_density = "Vertical"` currently produces the same output as `where_density = "Tall"`.
2029 #### `"CompressedIfEmpty"`:
2033 fn ipsum<Dolor>(dolor: Dolor) -> Sit
2036 fn ipsum<Dolor>(dolor: Dolor) -> Sit
2045 #### `"Compressed"`:
2049 fn ipsum<Dolor>(dolor: Dolor) -> Sit
2052 fn ipsum<Dolor>(dolor: Dolor) -> Sit
2063 fn ipsum<Dolor>(dolor: Dolor) -> Sit
2067 fn ipsum<Dolor>(dolor: Dolor) -> Sit
2076 **Note:** `where_density = "Tall"` currently produces the same output as `where_density = "Vertical"`.
2078 See also: [`where_layout`](#where_layout), [`indent_style`](#indent_style).
2082 Element layout inside a where clause
2084 - **Default value**: `"Vertical"`
2085 - **Possible values**: `"Horizontal"`, `"HorizontalVertical"`, `"Mixed"`, `"Vertical"`
2087 #### `"Vertical"` (default):
2090 fn lorem<Ipsum, Dolor>(ipsum: Ipsum, dolor: Dolor)
2091 where Ipsum: IpsumDolorSitAmet,
2092 Dolor: DolorSitAmetConsectetur
2097 fn lorem<Ipsum, Dolor, Sit, Amet>(ipsum: Ipsum, dolor: Dolor, sit: Sit, amet: Amet)
2098 where Ipsum: IpsumDolorSitAmet,
2099 Dolor: DolorSitAmetConsectetur,
2100 Sit: SitAmetConsecteturAdipiscing,
2101 Amet: AmetConsecteturAdipiscingElit
2107 #### `"Horizontal"`:
2110 fn lorem<Ipsum, Dolor>(ipsum: Ipsum, dolor: Dolor)
2111 where Ipsum: IpsumDolorSitAmet, Dolor: DolorSitAmetConsectetur
2116 fn lorem<Ipsum, Dolor, Sit, Amet>(ipsum: Ipsum, dolor: Dolor, sit: Sit, amet: Amet)
2117 where Ipsum: IpsumDolorSitAmet, Dolor: DolorSitAmetConsectetur, Sit: SitAmetConsecteturAdipiscing, Amet: AmetConsecteturAdipiscingElit
2123 #### `"HorizontalVertical"`:
2126 fn lorem<Ipsum, Dolor>(ipsum: Ipsum, dolor: Dolor)
2127 where Ipsum: IpsumDolorSitAmet, Dolor: DolorSitAmetConsectetur
2132 fn lorem<Ipsum, Dolor, Sit, Amet>(ipsum: Ipsum, dolor: Dolor, sit: Sit, amet: Amet)
2133 where Ipsum: IpsumDolorSitAmet,
2134 Dolor: DolorSitAmetConsectetur,
2135 Sit: SitAmetConsecteturAdipiscing,
2136 Amet: AmetConsecteturAdipiscingElit
2145 fn lorem<Ipsum, Dolor>(ipsum: Ipsum, dolor: Dolor)
2146 where Ipsum: IpsumDolorSitAmet, Dolor: DolorSitAmetConsectetur
2151 fn lorem<Ipsum, Dolor, Sit, Amet>(ipsum: Ipsum, dolor: Dolor, sit: Sit, amet: Amet)
2152 where Ipsum: IpsumDolorSitAmet, Dolor: DolorSitAmetConsectetur,
2153 Sit: SitAmetConsecteturAdipiscing, Amet: AmetConsecteturAdipiscingElit
2159 See also: [`where_density`](#where_density), [`indent_style`](#indent_style).
2163 Break comments to fit on the line
2165 - **Default value**: `false`
2166 - **Possible values**: `true`, `false`
2168 #### `false` (default):
2171 // 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.
2177 // Lorem ipsum dolor sit amet, consectetur adipiscing elit,
2178 // sed do eiusmod tempor incididunt ut labore et dolore
2179 // magna aliqua. Ut enim ad minim veniam, quis nostrud
2180 // exercitation ullamco laboris nisi ut aliquip ex ea
2181 // commodo consequat.
2184 ## `wrap_match_arms`
2186 Wrap the body of arms in blocks when it does not fit on the same line with the pattern of arms
2188 - **Default value**: `true`
2189 - **Possible values**: `true`, `false`
2191 #### `true` (default):
2196 foooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo(x)
2198 false => println!("{}", sit),
2207 foooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo(x),
2208 false => println!("{}", sit),
2212 See also: [`indent_match_arms`](#indent_match_arms), [`match_block_trailing_comma`](#match_block_trailing_comma).
2216 What Write Mode to use when none is supplied: Replace, Overwrite, Display, Diff, Coverage
2218 - **Default value**: `"Overwrite"`
2219 - **Possible values**: `"Checkstyle"`, `"Coverage"`, `"Diff"`, `"Display"`, `"Overwrite"`, `"Plain"`, `"Replace"`