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).
444 ## `combine_control_expr`
446 Combine control expressions with function calls.
448 - **Default value**: `true`
449 - **Possible values**: `true`, `false`
451 #### `true` (default):
463 foo!(if let Some(..) = x {
476 foo!(while let Some(..) = x {
510 if let Some(..) = x {
527 while let Some(..) = x {
553 Maximum length of comments. No effect unless`wrap_comments = true`.
555 - **Default value**: `80`
556 - **Possible values**: any positive integer
558 **Note:** A value of `0` results in [`wrap_comments`](#wrap_comments) being applied regardless of a line's width.
560 #### Comments shorter than `comment_width`:
562 // Lorem ipsum dolor sit amet, consectetur adipiscing elit.
565 #### Comments longer than `comment_width`:
567 // Lorem ipsum dolor sit amet,
568 // consectetur adipiscing elit.
571 See also [`wrap_comments`](#wrap_comments).
573 ## `condense_wildcard_suffixes`
575 Replace strings of _ wildcards by a single .. in tuple patterns
577 - **Default value**: `false`
578 - **Possible values**: `true`, `false`
580 #### `false` (default):
583 let (lorem, ipsum, _, _) = (1, 2, 3, 4);
589 let (lorem, ipsum, ..) = (1, 2, 3, 4);
592 ## `control_brace_style`
594 Brace style for control flow constructs
596 - **Default value**: `"AlwaysSameLine"`
597 - **Possible values**: `"AlwaysNextLine"`, `"AlwaysSameLine"`, `"ClosingNextLine"`
599 #### `"AlwaysSameLine"` (default):
609 #### `"AlwaysNextLine"`:
622 #### `"ClosingNextLine"`:
633 ## `disable_all_formatting`
635 Don't reformat anything
637 - **Default value**: `false`
638 - **Possible values**: `true`, `false`
640 ## `error_on_line_overflow`
642 Error if unable to get all lines within `max_width`
644 - **Default value**: `true`
645 - **Possible values**: `true`, `false`
647 See also [`max_width`](#max_width).
649 ## `error_on_line_overflow_comments`
651 Error if unable to get all comment lines within `comment_width`.
653 - **Default value**: `true`
654 - **Possible values**: `true`, `false`
656 See also [`comment_width`](#comment_width).
660 Argument density in functions
662 - **Default value**: `"Tall"`
663 - **Possible values**: `"Compressed"`, `"CompressedIfEmpty"`, `"Tall"`, `"Vertical"`
665 #### `"Tall"` (default):
669 fn lorem(ipsum: Ipsum, dolor: Dolor, sit: Sit, amet: Amet);
671 fn lorem(ipsum: Ipsum, dolor: Dolor, sit: Sit, amet: Amet) {
680 consectetur: Consectetur,
681 adipiscing: Adipiscing,
690 consectetur: Consectetur,
691 adipiscing: Adipiscing,
703 fn lorem(ipsum: Ipsum, dolor: Dolor, sit: Sit, amet: Amet);
705 fn lorem(ipsum: Ipsum, dolor: Dolor, sit: Sit, amet: Amet) {
710 ipsum: Ipsum, dolor: Dolor, sit: Sit, amet: Amet, consectetur: Consectetur,
711 adipiscing: Adipiscing, elit: Elit,
715 ipsum: Ipsum, dolor: Dolor, sit: Sit, amet: Amet, consectetur: Consectetur,
716 adipiscing: Adipiscing, elit: Elit,
723 #### `"CompressedIfEmpty"`:
727 fn lorem(ipsum: Ipsum, dolor: Dolor, sit: Sit, amet: Amet);
729 fn lorem(ipsum: Ipsum, dolor: Dolor, sit: Sit, amet: Amet) {
734 ipsum: Ipsum, dolor: Dolor, sit: Sit, amet: Amet, consectetur: Consectetur,
735 adipiscing: Adipiscing, elit: Elit,
743 consectetur: Consectetur,
744 adipiscing: Adipiscing,
756 fn lorem(ipsum: Ipsum,
761 fn lorem(ipsum: Ipsum,
768 fn lorem(ipsum: Ipsum,
772 consectetur: Consectetur,
773 adipiscing: Adipiscing,
776 fn lorem(ipsum: Ipsum,
780 consectetur: Consectetur,
781 adipiscing: Adipiscing,
791 Brace style for items
793 - **Default value**: `"SameLineWhere"`
794 - **Possible values**: `"AlwaysNextLine"`, `"PreferSameLine"`, `"SameLineWhere"`
798 #### `"SameLineWhere"` (default):
805 fn lorem(ipsum: usize) {
809 fn lorem<T>(ipsum: T)
811 T: Add + Sub + Mul + Div,
817 #### `"AlwaysNextLine"`:
825 fn lorem(ipsum: usize)
830 fn lorem<T>(ipsum: T)
832 T: Add + Sub + Mul + Div,
838 #### `"PreferSameLine"`:
845 fn lorem(ipsum: usize) {
849 fn lorem<T>(ipsum: T)
851 T: Add + Sub + Mul + Div, {
856 ### Structs and enums
858 #### `"SameLineWhere"` (default):
872 #### `"AlwaysNextLine"`:
887 #### `"PreferSameLine"`:
902 Maximum width of the args of a function call before falling back to vertical formatting
904 - **Default value**: `60`
905 - **Possible values**: any positive integer
907 **Note:** A value of `0` results in vertical formatting being applied regardless of a line's width.
909 #### Function call shorter than `fn_call_width`:
911 lorem("lorem", "ipsum", "dolor", "sit", "amet", "consectetur", "adipiscing", "elit");
914 #### Function call longer than `fn_call_width`:
916 See [`indent_style`](#indent_style).
918 ## `fn_empty_single_line`
920 Put empty-body functions on a single line
922 - **Default value**: `true`
923 - **Possible values**: `true`, `false`
925 #### `true` (default):
938 See also [`control_brace_style`](#control_brace_style).
943 Put single-expression functions on a single line
945 - **Default value**: `false`
946 - **Possible values**: `true`, `false`
948 #### `false` (default):
951 fn lorem() -> usize {
955 fn lorem() -> usize {
964 fn lorem() -> usize { 42 }
966 fn lorem() -> usize {
972 See also [`control_brace_style`](#control_brace_style).
974 ## `force_explicit_abi`
976 Always print the abi for extern items
978 - **Default value**: `true`
979 - **Possible values**: `true`, `false`
981 **Note:** Non-"C" ABIs are always printed. If `false` then "C" is removed.
983 #### `true` (default):
987 pub static lorem: c_int;
995 pub static lorem: c_int;
1001 Format string literals where necessary
1003 - **Default value**: `false`
1004 - **Possible values**: `true`, `false`
1006 #### `false` (default):
1009 let lorem = "ipsum dolor sit amet consectetur adipiscing elit lorem ipsum dolor sit";
1016 "ipsum dolor sit amet consectetur \
1017 adipiscing elit lorem ipsum dolor sit";
1020 See also [`max_width`](#max_width).
1024 Use tab characters for indentation, spaces for alignment
1026 - **Default value**: `false`
1027 - **Possible values**: `true`, `false`
1029 #### `false` (default):
1032 fn lorem() -> usize {
1033 42 // spaces before 42
1040 fn lorem() -> usize {
1041 42 // tabs before 42
1045 See also: [`tab_spaces`](#tab_spaces).
1047 ## `impl_empty_single_line`
1049 Put empty-body implementations on a single line
1051 - **Default value**: `true`
1052 - **Possible values**: `true`, `false`
1054 #### `true` (default):
1067 See also [`brace_style`](#brace_style).
1069 ## `indent_match_arms`
1071 Indent match arms instead of keeping them at the same indentation level as the match keyword
1073 - **Default value**: `true`
1074 - **Possible values**: `true`, `false`
1076 #### `true` (default):
1098 See also: [`match_block_trailing_comma`](#match_block_trailing_comma), [`wrap_match_arms`](#wrap_match_arms).
1102 Indent style of imports
1104 - **Default Value**: `"Visual"`
1105 - **Possible values**: `"Block"`, `"Visual"`
1107 #### `"Visual"` (default):
1125 See also: [`imports_layout`](#imports_layout).
1129 Item layout inside a imports block
1131 - **Default value**: "Mixed"
1132 - **Possible values**: "Horizontal", "HorizontalVertical", "Mixed", "Vertical"
1134 #### `"Mixed"` (default):
1137 use foo::{xxx, yyy, zzz};
1139 use foo::{aaa, bbb, ccc,
1143 #### `"Horizontal"`:
1145 **Note**: This option forces to put everything on one line and may exceeds `max_width`.
1148 use foo::{xxx, yyy, zzz};
1150 use foo::{aaa, bbb, ccc, ddd, eee, fff};
1153 #### `"HorizontalVertical"`:
1156 use foo::{xxx, yyy, zzz};
1181 ## `match_arm_forces_newline`
1183 Consistently put match arms (block based or not) in a newline.
1185 - **Default value**: `false`
1186 - **Possible values**: `true`, `false`
1188 #### `false` (default):
1192 // a non-empty block
1199 X2 => println!("ok"),
1207 // a non-empty block
1221 See also: [`wrap_match_arms`](#wrap_match_arms).
1223 ## `match_block_trailing_comma`
1225 Put a trailing comma after a block based match arm (non-block arms are not affected)
1227 - **Default value**: `false`
1228 - **Possible values**: `true`, `false`
1230 #### `false` (default):
1237 Lorem::Dolor => println!("dolor"),
1248 Lorem::Dolor => println!("dolor"),
1252 See also: [`indent_match_arms`](#indent_match_arms), [`trailing_comma`](#trailing_comma), [`wrap_match_arms`](#wrap_match_arms).
1256 Maximum width of each line
1258 - **Default value**: `100`
1259 - **Possible values**: any positive integer
1261 See also [`error_on_line_overflow`](#error_on_line_overflow).
1265 Merge multiple derives into a single one.
1267 - **Default value**: `true`
1268 - **Possible values**: `true`, `false`
1270 #### `true` (default):
1273 #[derive(Eq, PartialEq, Debug, Copy, Clone)]
1280 #[derive(Eq, PartialEq)]
1282 #[derive(Copy, Clone)]
1286 ## `multiline_closure_forces_block`
1288 Force multiline closure bodies to be wrapped in a block
1290 - **Default value**: `false`
1291 - **Possible values**: `false`, `true`
1293 #### `false` (default):
1296 result.and_then(|maybe_value| match maybe_value {
1306 result.and_then(|maybe_value| {
1314 ## `multiline_match_arm_forces_block`
1316 Force multiline match arm bodies to be wrapped in a block
1318 - **Default value**: `false`
1319 - **Possible values**: `false`, `true`
1321 #### `false` (default):
1326 println!("Hello World");
1338 println!("Hello World");
1347 Unix or Windows line endings
1349 - **Default value**: `"Unix"`
1350 - **Possible values**: `"Native"`, `"Unix"`, `"Windows"`
1352 ## `normalize_comments`
1354 Convert /* */ comments to // comments where possible
1356 - **Default value**: `false`
1357 - **Possible values**: `true`, `false`
1359 #### `false` (default):
1363 fn dolor() -> usize {}
1366 fn adipiscing() -> usize {}
1373 fn dolor() -> usize {}
1376 fn adipiscing() -> usize {}
1379 ## `reorder_imported_names`
1381 Reorder lists of names in import statements alphabetically
1383 - **Default value**: `false`
1384 - **Possible values**: `true`, `false`
1386 #### `false` (default):
1389 use super::{lorem, ipsum, dolor, sit};
1395 use super::{dolor, ipsum, lorem, sit};
1398 See also [`reorder_imports`](#reorder_imports).
1400 ## `reorder_imports`
1402 Reorder import statements alphabetically
1404 - **Default value**: `false`
1405 - **Possible values**: `true`, `false`
1407 #### `false` (default):
1425 See also [`reorder_imported_names`](#reorder_imported_names), [`reorder_imports_in_group`](#reorder_imports_in_group).
1427 ## `reorder_imports_in_group`
1429 Reorder import statements in group
1431 - **Default value**: `false`
1432 - **Possible values**: `true`, `false`
1434 **Note:** This option takes effect only when [`reorder_imports`](#reorder_imports) is set to `true`.
1436 #### `false` (default):
1460 See also [`reorder_imports`](#reorder_imports).
1462 ## `reorder_extern_crates`
1464 Reorder `extern crate` statements alphabetically
1466 - **Default value**: `true`
1467 - **Possible values**: `true`, `false`
1469 #### `true` (default):
1487 See also [`reorder_extern_crates_in_group`](#reorder_extern_crates_in_group).
1489 ## `reorder_extern_crates_in_group`
1491 Reorder `extern crate` statements in group
1493 - **Default value**: `true`
1494 - **Possible values**: `true`, `false`
1496 **Note:** This option takes effect only when [`reorder_imports`](#reorder_imports) is set to `true`.
1498 #### `true` (default):
1522 See also [`reorder_extern_crates`](#reorder_extern_crates).
1526 Report `TODO` items in comments.
1528 - **Default value**: `"Never"`
1529 - **Possible values**: `"Always"`, `"Unnumbered"`, `"Never"`
1531 Warns about any comments containing `TODO` in them when set to `"Always"`. If
1532 it contains a `#X` (with `X` being a number) in parentheses following the
1533 `TODO`, `"Unnumbered"` will ignore it.
1535 See also [`report_fixme`](#report_fixme).
1539 Report `FIXME` items in comments.
1541 - **Default value**: `"Never"`
1542 - **Possible values**: `"Always"`, `"Unnumbered"`, `"Never"`
1544 Warns about any comments containing `FIXME` in them when set to `"Always"`. If
1545 it contains a `#X` (with `X` being a number) in parentheses following the
1546 `FIXME`, `"Unnumbered"` will ignore it.
1548 See also [`report_todo`](#report_todo).
1550 ## `single_line_if_else_max_width`
1552 Maximum line length for single line if-else expressions.
1554 - **Default value**: `50`
1555 - **Possible values**: any positive integer
1557 **Note:** A value of `0` results in if-else expressions being broken regardless of their line's width.
1559 #### Lines shorter than `single_line_if_else_max_width`:
1561 let lorem = if ipsum { dolor } else { sit };
1564 #### Lines longer than `single_line_if_else_max_width`:
1566 let lorem = if ipsum {
1573 See also: [`control_brace_style`](#control_brace_style).
1577 Don't reformat out of line modules
1579 - **Default value**: `false`
1580 - **Possible values**: `true`, `false`
1582 ## `space_after_colon`
1584 Leave a space after the colon.
1586 - **Default value**: `true`
1587 - **Possible values**: `true`, `false`
1589 #### `true` (default):
1592 fn lorem<T: Eq>(t: T) {
1593 let lorem: Dolor = Lorem {
1603 fn lorem<T:Eq>(t:T) {
1604 let lorem:Dolor = Lorem {
1611 See also: [`space_before_colon`](#space_before_colon).
1613 ## `space_before_colon`
1615 Leave a space before the colon.
1617 - **Default value**: `false`
1618 - **Possible values**: `true`, `false`
1620 #### `false` (default):
1623 fn lorem<T: Eq>(t: T) {
1624 let lorem: Dolor = Lorem {
1634 fn lorem<T : Eq>(t : T) {
1635 let lorem : Dolor = Lorem {
1642 See also: [`space_after_colon`](#space_after_colon).
1644 ## `struct_field_align_threshold`
1646 The maximum diff of width between struct fields to be aligned with each other.
1648 - **Default value** : 0
1649 - **Possible values**: any positive integer
1673 ## `spaces_around_ranges`
1675 Put spaces around the .. and ... range operators
1677 - **Default value**: `false`
1678 - **Possible values**: `true`, `false`
1680 #### `false` (default):
1689 let lorem = 0 .. 10;
1692 ## `spaces_within_parens_and_brackets`
1694 Put spaces within non-empty generic arguments
1696 - **Default value**: `false`
1697 - **Possible values**: `true`, `false`
1699 #### `false` (default):
1702 fn lorem<T: Eq>(t: T) {
1710 fn lorem< T: Eq >(t: T) {
1715 See also: [`spaces_within_parens_and_brackets`](#spaces_within_parens_and_brackets), [`spaces_within_parens_and_brackets`](#spaces_within_parens_and_brackets).
1717 ## `spaces_within_parens_and_brackets`
1719 Put spaces within non-empty parentheses
1721 - **Default value**: `false`
1722 - **Possible values**: `true`, `false`
1724 #### `false` (default):
1727 fn lorem<T: Eq>(t: T) {
1728 let lorem = (ipsum, dolor);
1735 fn lorem<T: Eq>( t: T ) {
1736 let lorem = ( ipsum, dolor );
1740 See also: [`spaces_within_parens_and_brackets`](#spaces_within_parens_and_brackets), [`spaces_within_parens_and_brackets`](#spaces_within_parens_and_brackets).
1742 ## `spaces_within_parens_and_brackets`
1744 Put spaces within non-empty square brackets
1746 - **Default value**: `false`
1747 - **Possible values**: `true`, `false`
1749 #### `false` (default):
1752 let lorem: [usize; 2] = [ipsum, dolor];
1758 let lorem: [ usize; 2 ] = [ 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 ## `struct_lit_multiline_style`
1765 Multiline style on literal structs
1767 - **Default value**: `"PreferSingle"`
1768 - **Possible values**: `"ForceMulti"`, `"PreferSingle"`
1770 #### `"PreferSingle"` (default):
1773 let lorem = Lorem { ipsum: dolor, sit: amet };
1776 #### `"ForceMulti"`:
1785 See also: [`indent_style`](#indent_style), [`struct_lit_width`](#struct_lit_width).
1787 ## `struct_lit_width`
1789 Maximum width in the body of a struct lit before falling back to vertical formatting
1791 - **Default value**: `18`
1792 - **Possible values**: any positive integer
1794 **Note:** A value of `0` results in vertical formatting being applied regardless of a line's width.
1796 #### Lines shorter than `struct_lit_width`:
1798 let lorem = Lorem { ipsum: dolor, sit: amet };
1801 #### Lines longer than `struct_lit_width`:
1802 See [`indent_style`](#indent_style).
1804 See also: [`struct_lit_multiline_style`](#struct_lit_multiline_style), [`indent_style`](#indent_style).
1806 ## `struct_variant_width`
1808 Maximum width in the body of a struct variant before falling back to vertical formatting
1810 - **Default value**: `35`
1811 - **Possible values**: any positive integer
1813 **Note:** A value of `0` results in vertical formatting being applied regardless of a line's width.
1815 #### Struct variants shorter than `struct_variant_width`:
1820 Sit { amet: Consectetur, adipiscing: Elit },
1824 #### Struct variants longer than `struct_variant_width`:
1838 Number of spaces per tab
1840 - **Default value**: `4`
1841 - **Possible values**: any positive integer
1847 let ipsum = dolor();
1849 "amet consectetur adipiscing elit."
1858 let ipsum = dolor();
1860 "amet consectetur adipiscing elit."
1865 See also: [`hard_tabs`](#hard_tabs).
1870 How to handle trailing commas for lists
1872 - **Default value**: `"Vertical"`
1873 - **Possible values**: `"Always"`, `"Never"`, `"Vertical"`
1875 #### `"Vertical"` (default):
1878 let Lorem { ipsum, dolor, sit } = amet;
1892 let Lorem { ipsum, dolor, sit, } = amet;
1906 let Lorem { ipsum, dolor, sit } = amet;
1917 See also: [`match_block_trailing_comma`](#match_block_trailing_comma).
1919 ## `trailing_semicolon`
1921 Add trailing semicolon after break, continue and return
1923 - **Default value**: `true`
1924 - **Possible values**: `true`, `false`
1926 #### `true` (default):
1940 ## `type_punctuation_density`
1942 Determines if `+` or `=` are wrapped in spaces in the punctuation of types
1944 - **Default value**: `"Wide"`
1945 - **Possible values**: `"Compressed"`, `"Wide"`
1947 #### `"Wide"` (default):
1950 fn lorem<Ipsum: Dolor + Sit = Amet>() {
1955 #### `"Compressed"`:
1958 fn lorem<Ipsum: Dolor+Sit=Amet>() {
1963 ## `use_try_shorthand`
1965 Replace uses of the try! macro by the ? shorthand
1967 - **Default value**: `false`
1968 - **Possible values**: `true`, `false`
1970 #### `false` (default):
1973 let lorem = try!(ipsum.map(|dolor|dolor.sit()));
1979 let lorem = ipsum.map(|dolor| dolor.sit())?;
1984 Density of a where clause.
1986 - **Default value**: `"Vertical"`
1987 - **Possible values**: `"Compressed"`, `"CompressedIfEmpty"`, `"Tall"`, `"Vertical"`
1989 #### `"Vertical"` (default):
1993 fn ipsum<Dolor>(dolor: Dolor) -> Sit
1997 fn ipsum<Dolor>(dolor: Dolor) -> Sit
2006 **Note:** `where_density = "Vertical"` currently produces the same output as `where_density = "Tall"`.
2008 #### `"CompressedIfEmpty"`:
2012 fn ipsum<Dolor>(dolor: Dolor) -> Sit
2015 fn ipsum<Dolor>(dolor: Dolor) -> Sit
2024 #### `"Compressed"`:
2028 fn ipsum<Dolor>(dolor: Dolor) -> Sit
2031 fn ipsum<Dolor>(dolor: Dolor) -> Sit
2042 fn ipsum<Dolor>(dolor: Dolor) -> Sit
2046 fn ipsum<Dolor>(dolor: Dolor) -> Sit
2055 **Note:** `where_density = "Tall"` currently produces the same output as `where_density = "Vertical"`.
2057 See also: [`where_layout`](#where_layout), [`indent_style`](#indent_style).
2061 Element layout inside a where clause
2063 - **Default value**: `"Vertical"`
2064 - **Possible values**: `"Horizontal"`, `"HorizontalVertical"`, `"Mixed"`, `"Vertical"`
2066 #### `"Vertical"` (default):
2069 fn lorem<Ipsum, Dolor>(ipsum: Ipsum, dolor: Dolor)
2070 where Ipsum: IpsumDolorSitAmet,
2071 Dolor: DolorSitAmetConsectetur
2076 fn lorem<Ipsum, Dolor, Sit, Amet>(ipsum: Ipsum, dolor: Dolor, sit: Sit, amet: Amet)
2077 where Ipsum: IpsumDolorSitAmet,
2078 Dolor: DolorSitAmetConsectetur,
2079 Sit: SitAmetConsecteturAdipiscing,
2080 Amet: AmetConsecteturAdipiscingElit
2086 #### `"Horizontal"`:
2089 fn lorem<Ipsum, Dolor>(ipsum: Ipsum, dolor: Dolor)
2090 where Ipsum: IpsumDolorSitAmet, Dolor: DolorSitAmetConsectetur
2095 fn lorem<Ipsum, Dolor, Sit, Amet>(ipsum: Ipsum, dolor: Dolor, sit: Sit, amet: Amet)
2096 where Ipsum: IpsumDolorSitAmet, Dolor: DolorSitAmetConsectetur, Sit: SitAmetConsecteturAdipiscing, Amet: AmetConsecteturAdipiscingElit
2102 #### `"HorizontalVertical"`:
2105 fn lorem<Ipsum, Dolor>(ipsum: Ipsum, dolor: Dolor)
2106 where Ipsum: IpsumDolorSitAmet, Dolor: DolorSitAmetConsectetur
2111 fn lorem<Ipsum, Dolor, Sit, Amet>(ipsum: Ipsum, dolor: Dolor, sit: Sit, amet: Amet)
2112 where Ipsum: IpsumDolorSitAmet,
2113 Dolor: DolorSitAmetConsectetur,
2114 Sit: SitAmetConsecteturAdipiscing,
2115 Amet: AmetConsecteturAdipiscingElit
2124 fn lorem<Ipsum, Dolor>(ipsum: Ipsum, dolor: Dolor)
2125 where Ipsum: IpsumDolorSitAmet, Dolor: DolorSitAmetConsectetur
2130 fn lorem<Ipsum, Dolor, Sit, Amet>(ipsum: Ipsum, dolor: Dolor, sit: Sit, amet: Amet)
2131 where Ipsum: IpsumDolorSitAmet, Dolor: DolorSitAmetConsectetur,
2132 Sit: SitAmetConsecteturAdipiscing, Amet: AmetConsecteturAdipiscingElit
2138 See also: [`where_density`](#where_density), [`indent_style`](#indent_style).
2142 Break comments to fit on the line
2144 - **Default value**: `false`
2145 - **Possible values**: `true`, `false`
2147 #### `false` (default):
2150 // 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.
2156 // Lorem ipsum dolor sit amet, consectetur adipiscing elit,
2157 // sed do eiusmod tempor incididunt ut labore et dolore
2158 // magna aliqua. Ut enim ad minim veniam, quis nostrud
2159 // exercitation ullamco laboris nisi ut aliquip ex ea
2160 // commodo consequat.
2163 ## `wrap_match_arms`
2165 Wrap the body of arms in blocks when it does not fit on the same line with the pattern of arms
2167 - **Default value**: `true`
2168 - **Possible values**: `true`, `false`
2170 #### `true` (default):
2175 foooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo(x)
2177 false => println!("{}", sit),
2186 foooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo(x),
2187 false => println!("{}", sit),
2191 See also: [`indent_match_arms`](#indent_match_arms), [`match_block_trailing_comma`](#match_block_trailing_comma).
2195 What Write Mode to use when none is supplied: Replace, Overwrite, Display, Diff, Coverage
2197 - **Default value**: `"Overwrite"`
2198 - **Possible values**: `"Checkstyle"`, `"Coverage"`, `"Diff"`, `"Display"`, `"Overwrite"`, `"Plain"`, `"Replace"`