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:
9 reorder_imports = false
12 Each configuration option is either stable or unstable.
13 Stable options can be used directly, while unstable options are opt-in.
14 To enable unstable options, set `unstable_features = true` in `rustfmt.toml` or pass `--unstable-features` to rustfmt.
16 # Configuration Options
18 Below you find a detailed visual guide on all the supported configuration options of rustfmt:
23 Indent on expressions or items.
25 - **Default value**: `"Block"`
26 - **Possible values**: `"Block"`, `"Visual"`
31 #### `"Block"` (default):
51 let lorem = vec!["ipsum",
63 #### `"Block"` (default):
97 See also: [`control_brace_style`](#control_brace_style).
99 ### Function arguments
101 #### `"Block"` (default):
106 fn lorem(ipsum: usize) {}
126 fn lorem(ipsum: usize) {}
128 fn lorem(ipsum: usize,
141 #### `"Block"` (default):
175 #### `"Block"` (default):
183 Adipiscing: Eq = usize,
184 Consectetur: Eq = usize,
191 adipiscing: Adipiscing,
192 consectetur: Consectetur,
202 fn lorem<Ipsum: Eq = usize,
206 Adipiscing: Eq = usize,
207 Consectetur: Eq = usize,
213 adipiscing: Adipiscing,
214 consectetur: Consectetur,
223 #### `"Block"` (default):
238 let lorem = Lorem { ipsum: dolor,
243 See also: [`struct_lit_single_line`](#struct_lit_single_line), [`indent_style`](#indent_style).
247 #### `"Block"` (default):
250 fn lorem<Ipsum, Dolor, Sit, Amet>() -> T
264 fn lorem<Ipsum, Dolor, Sit, Amet>() -> T
274 ## `use_small_heuristics`
276 Whether to use different formatting for items and expressions if they satisfy a heuristic notion of 'small'.
278 - **Default value**: `Default`
279 - **Possible values**: `Default`, `Off`, `Max`
282 #### `Default` (default):
288 Sit { amet: Consectetur, adipiscing: Elit },
306 let lorem = Lorem { ipsum: dolor };
308 let lorem = if ipsum { dolor } else { sit };
325 lorem("lorem", "ipsum", "dolor", "sit", "amet", "consectetur", "adipiscing");
332 let lorem = if ipsum {
346 Sit { amet: Consectetur, adipiscing: Elit },
350 lorem("lorem", "ipsum", "dolor", "sit", "amet", "consectetur", "adipiscing");
352 let lorem = Lorem { ipsum: dolor, sit: amet };
354 let lorem = if ipsum { dolor } else { sit };
360 Where to put a binary operator when a binary expression goes multiline.
362 - **Default value**: `"Front"`
363 - **Possible values**: `"Front"`, `"Back"`
366 #### `"Front"` (default):
370 let or = foofoofoofoofoofoofoofoofoofoofoofoofoofoofoofoo
371 || barbarbarbarbarbarbarbarbarbarbarbarbarbarbarbar;
373 let sum = 123456789012345678901234567890
374 + 123456789012345678901234567890
375 + 123456789012345678901234567890;
377 let range = aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
378 ..bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb;
386 let or = foofoofoofoofoofoofoofoofoofoofoofoofoofoofoofoo ||
387 barbarbarbarbarbarbarbarbarbarbarbarbarbarbarbar;
389 let sum = 123456789012345678901234567890 +
390 123456789012345678901234567890 +
391 123456789012345678901234567890;
393 let range = aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa..
394 bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb;
398 ## `combine_control_expr`
400 Combine control expressions with function calls.
402 - **Default value**: `true`
403 - **Possible values**: `true`, `false`
406 #### `true` (default):
418 foo!(if let Some(..) = x {
431 foo!(while let Some(..) = x {
465 if let Some(..) = x {
482 while let Some(..) = x {
508 Maximum length of comments. No effect unless`wrap_comments = true`.
510 - **Default value**: `80`
511 - **Possible values**: any positive integer
514 **Note:** A value of `0` results in [`wrap_comments`](#wrap_comments) being applied regardless of a line's width.
516 #### `80` (default; comments shorter than `comment_width`):
518 // Lorem ipsum dolor sit amet, consectetur adipiscing elit.
521 #### `60` (comments longer than `comment_width`):
523 // Lorem ipsum dolor sit amet,
524 // consectetur adipiscing elit.
527 See also [`wrap_comments`](#wrap_comments).
529 ## `condense_wildcard_suffixes`
531 Replace strings of _ wildcards by a single .. in tuple patterns
533 - **Default value**: `false`
534 - **Possible values**: `true`, `false`
537 #### `false` (default):
541 let (lorem, ipsum, _, _) = (1, 2, 3, 4);
542 let (lorem, ipsum, ..) = (1, 2, 3, 4);
550 let (lorem, ipsum, ..) = (1, 2, 3, 4);
554 ## `control_brace_style`
556 Brace style for control flow constructs
558 - **Default value**: `"AlwaysSameLine"`
559 - **Possible values**: `"AlwaysNextLine"`, `"AlwaysSameLine"`, `"ClosingNextLine"`
562 #### `"AlwaysSameLine"` (default):
574 #### `"AlwaysNextLine"`:
589 #### `"ClosingNextLine"`:
602 ## `disable_all_formatting`
604 Don't reformat anything
606 - **Default value**: `false`
607 - **Possible values**: `true`, `false`
610 ## `error_on_line_overflow`
612 Error if Rustfmt is unable to get all lines within `max_width`, except for comments and string
613 literals. If this happens, then it is a bug in Rustfmt. You might be able to work around the bug by
614 refactoring your code to avoid long/complex expressions, usually by extracting a local variable or
615 using a shorter name.
617 - **Default value**: `false`
618 - **Possible values**: `true`, `false`
621 See also [`max_width`](#max_width).
623 ## `error_on_unformatted`
625 Error if unable to get comments or string literals within `max_width`, or they are left with
626 trailing whitespaces.
628 - **Default value**: `false`
629 - **Possible values**: `true`, `false`
634 Argument density in functions
636 - **Default value**: `"Tall"`
637 - **Possible values**: `"Compressed"`, `"Tall"`, `"Vertical"`
640 #### `"Tall"` (default):
644 fn lorem(ipsum: Ipsum, dolor: Dolor, sit: Sit, amet: Amet);
646 fn lorem(ipsum: Ipsum, dolor: Dolor, sit: Sit, amet: Amet) {
655 consectetur: Consectetur,
656 adipiscing: Adipiscing,
665 consectetur: Consectetur,
666 adipiscing: Adipiscing,
678 fn lorem(ipsum: Ipsum, dolor: Dolor, sit: Sit, amet: Amet);
680 fn lorem(ipsum: Ipsum, dolor: Dolor, sit: Sit, amet: Amet) {
685 ipsum: Ipsum, dolor: Dolor, sit: Sit, amet: Amet, consectetur: Consectetur,
686 adipiscing: Adipiscing, elit: Elit,
690 ipsum: Ipsum, dolor: Dolor, sit: Sit, amet: Amet, consectetur: Consectetur,
691 adipiscing: Adipiscing, elit: Elit,
723 consectetur: Consectetur,
724 adipiscing: Adipiscing,
733 consectetur: Consectetur,
734 adipiscing: Adipiscing,
745 Brace style for items
747 - **Default value**: `"SameLineWhere"`
748 - **Possible values**: `"AlwaysNextLine"`, `"PreferSameLine"`, `"SameLineWhere"`
753 #### `"SameLineWhere"` (default):
760 fn lorem(ipsum: usize) {
764 fn lorem<T>(ipsum: T)
766 T: Add + Sub + Mul + Div,
772 #### `"AlwaysNextLine"`:
780 fn lorem(ipsum: usize)
785 fn lorem<T>(ipsum: T)
787 T: Add + Sub + Mul + Div,
793 #### `"PreferSameLine"`:
800 fn lorem(ipsum: usize) {
804 fn lorem<T>(ipsum: T)
806 T: Add + Sub + Mul + Div, {
811 ### Structs and enums
813 #### `"SameLineWhere"` (default):
828 #### `"AlwaysNextLine"`:
844 #### `"PreferSameLine"`:
859 ## `empty_item_single_line`
861 Put empty-body functions and impls on a single line
863 - **Default value**: `true`
864 - **Possible values**: `true`, `false`
867 #### `true` (default):
885 See also [`brace_style`](#brace_style), [`control_brace_style`](#control_brace_style).
890 Put single-expression functions on a single line
892 - **Default value**: `false`
893 - **Possible values**: `true`, `false`
896 #### `false` (default):
899 fn lorem() -> usize {
903 fn lorem() -> usize {
912 fn lorem() -> usize { 42 }
914 fn lorem() -> usize {
920 See also [`control_brace_style`](#control_brace_style).
923 ## `where_single_line`
925 Forces the `where` clause to be laid out on a single line.
927 - **Default value**: `false`
928 - **Possible values**: `true`, `false`
931 #### `false` (default):
946 where Option<T>: Ipsum
952 See also [`brace_style`](#brace_style), [`control_brace_style`](#control_brace_style).
955 ## `force_explicit_abi`
957 Always print the abi for extern items
959 - **Default value**: `true`
960 - **Possible values**: `true`, `false`
963 **Note:** Non-"C" ABIs are always printed. If `false` then "C" is removed.
965 #### `true` (default):
969 pub static lorem: c_int;
977 pub static lorem: c_int;
983 Format string literals where necessary
985 - **Default value**: `false`
986 - **Possible values**: `true`, `false`
989 #### `false` (default):
994 "ipsum dolor sit amet consectetur adipiscing elit lorem ipsum dolor sit amet consectetur adipiscing";
1002 let lorem = "ipsum dolor sit amet consectetur adipiscing elit lorem ipsum dolor sit amet \
1003 consectetur adipiscing";
1007 See also [`max_width`](#max_width).
1009 ## `format_macro_matchers`
1011 Format the metavariable matching patterns in macros.
1013 - **Default value**: `false`
1014 - **Possible values**: `true`, `false`
1017 #### `false` (default):
1021 ($a: ident : $b: ty) => {
1024 ($a: ident $b: ident $c: ident) => {
1034 ($a:ident : $b:ty) => {
1037 ($a:ident $b:ident $c:ident) => {
1043 See also [`format_macro_bodies`](#format_macro_bodies).
1046 ## `format_macro_bodies`
1048 Format the bodies of macros.
1050 - **Default value**: `true`
1051 - **Possible values**: `true`, `false`
1054 #### `true` (default):
1058 ($a: ident : $b: ty) => {
1061 ($a: ident $b: ident $c: ident) => {
1071 ($a: ident : $b: ty) => { $a(42): $b; };
1072 ($a: ident $b: ident $c: ident) => { $a=$b+$c; };
1076 See also [`format_macro_matchers`](#format_macro_matchers).
1081 Use tab characters for indentation, spaces for alignment
1083 - **Default value**: `false`
1084 - **Possible values**: `true`, `false`
1087 #### `false` (default):
1090 fn lorem() -> usize {
1091 42 // spaces before 42
1098 fn lorem() -> usize {
1099 42 // tabs before 42
1103 See also: [`tab_spaces`](#tab_spaces).
1108 Indent style of imports
1110 - **Default Value**: `"Block"`
1111 - **Possible values**: `"Block"`, `"Visual"`
1114 #### `"Block"` (default):
1118 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx, yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy,
1119 zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz,
1126 use foo::{xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx, yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy,
1127 zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz};
1130 See also: [`imports_layout`](#imports_layout).
1134 Item layout inside a imports block
1136 - **Default value**: "Mixed"
1137 - **Possible values**: "Horizontal", "HorizontalVertical", "Mixed", "Vertical"
1140 #### `"Mixed"` (default):
1143 use foo::{xxxxxxxxxxxxxxxxxx, yyyyyyyyyyyyyyyyyy, zzzzzzzzzzzzzzzzzz};
1146 aaaaaaaaaaaaaaaaaa, bbbbbbbbbbbbbbbbbb, cccccccccccccccccc, dddddddddddddddddd,
1147 eeeeeeeeeeeeeeeeee, ffffffffffffffffff,
1151 #### `"Horizontal"`:
1153 **Note**: This option forces all imports onto one line and may exceed `max_width`.
1156 use foo::{xxx, yyy, zzz};
1158 use foo::{aaa, bbb, ccc, ddd, eee, fff};
1161 #### `"HorizontalVertical"`:
1164 use foo::{xxxxxxxxxxxxxxxxxx, yyyyyyyyyyyyyyyyyy, zzzzzzzzzzzzzzzzzz};
1197 Merge multiple imports into a single nested import.
1199 - **Default value**: `false`
1200 - **Possible values**: `true`, `false`
1203 #### `false` (default):
1214 use foo::{a, b, c, d, e, f, g};
1218 ## `match_block_trailing_comma`
1220 Put a trailing comma after a block based match arm (non-block arms are not affected)
1222 - **Default value**: `false`
1223 - **Possible values**: `true`, `false`
1226 #### `false` (default):
1234 Lorem::Dolor => println!("dolor"),
1247 Lorem::Dolor => println!("dolor"),
1252 See also: [`trailing_comma`](#trailing_comma), [`match_arm_blocks`](#match_arm_blocks).
1256 Maximum width of each line
1258 - **Default value**: `100`
1259 - **Possible values**: any positive integer
1262 See also [`error_on_line_overflow`](#error_on_line_overflow).
1266 Merge multiple derives into a single one.
1268 - **Default value**: `true`
1269 - **Possible values**: `true`, `false`
1272 #### `true` (default):
1275 #[derive(Eq, PartialEq, Debug, Copy, Clone)]
1282 #[derive(Eq, PartialEq)]
1284 #[derive(Copy, Clone)]
1288 ## `force_multiline_blocks`
1290 Force multiline closure and match arm bodies to be wrapped in a block
1292 - **Default value**: `false`
1293 - **Possible values**: `false`, `true`
1296 #### `false` (default):
1300 result.and_then(|maybe_value| match maybe_value {
1302 Some(value) => bar(),
1307 println!("Hello World");
1309 Some(dolor) => foo(),
1318 result.and_then(|maybe_value| {
1321 Some(value) => bar(),
1328 println!("Hello World");
1331 Some(dolor) => foo(),
1339 Unix or Windows line endings
1341 - **Default value**: `"Native"`
1342 - **Possible values**: `"Native"`, `"Unix"`, `"Windows"`
1345 ## `normalize_comments`
1347 Convert /* */ comments to // comments where possible
1349 - **Default value**: `false`
1350 - **Possible values**: `true`, `false`
1353 #### `false` (default):
1357 fn dolor() -> usize {}
1360 fn adipiscing() -> usize {}
1367 fn dolor() -> usize {}
1370 fn adipiscing() -> usize {}
1373 ## `remove_nested_parens`
1375 Remove nested parens.
1377 - **Default value**: `true`,
1378 - **Possible values**: `true`, `false`
1382 #### `true` (default):
1397 ## `reorder_imports`
1399 Reorder import and extern crate statements alphabetically in groups (a group is
1400 separated by a newline).
1402 - **Default value**: `true`
1403 - **Possible values**: `true`, `false`
1406 #### `true` (default):
1425 ## `reorder_modules`
1427 Reorder `mod` declarations alphabetically in group.
1429 - **Default value**: `true`
1430 - **Possible values**: `true`, `false`
1433 #### `true` (default)
1457 **Note** `mod` with `#[macro_export]` will not be reordered since that could change the semantic
1458 of the original source code.
1460 ## `reorder_impl_items`
1462 Reorder impl items. `type` and `const` are put first, then macros and methods.
1464 - **Default value**: `false`
1465 - **Possible values**: `true`, `false`
1468 #### `false` (default)
1473 impl Iterator for Dummy {
1474 fn next(&mut self) -> Option<Self::Item> {
1487 impl Iterator for Dummy {
1490 fn next(&mut self) -> Option<Self::Item> {
1498 Report `TODO` items in comments.
1500 - **Default value**: `"Never"`
1501 - **Possible values**: `"Always"`, `"Unnumbered"`, `"Never"`
1504 Warns about any comments containing `TODO` in them when set to `"Always"`. If
1505 it contains a `#X` (with `X` being a number) in parentheses following the
1506 `TODO`, `"Unnumbered"` will ignore it.
1508 See also [`report_fixme`](#report_fixme).
1512 Report `FIXME` items in comments.
1514 - **Default value**: `"Never"`
1515 - **Possible values**: `"Always"`, `"Unnumbered"`, `"Never"`
1518 Warns about any comments containing `FIXME` in them when set to `"Always"`. If
1519 it contains a `#X` (with `X` being a number) in parentheses following the
1520 `FIXME`, `"Unnumbered"` will ignore it.
1522 See also [`report_todo`](#report_todo).
1527 Don't reformat out of line modules
1529 - **Default value**: `false`
1530 - **Possible values**: `true`, `false`
1533 ## `space_after_colon`
1535 Leave a space after the colon.
1537 - **Default value**: `true`
1538 - **Possible values**: `true`, `false`
1541 #### `true` (default):
1544 fn lorem<T: Eq>(t: T) {
1545 let lorem: Dolor = Lorem {
1555 fn lorem<T:Eq>(t:T) {
1556 let lorem:Dolor = Lorem {
1563 See also: [`space_before_colon`](#space_before_colon).
1565 ## `space_before_colon`
1567 Leave a space before the colon.
1569 - **Default value**: `false`
1570 - **Possible values**: `true`, `false`
1573 #### `false` (default):
1576 fn lorem<T: Eq>(t: T) {
1577 let lorem: Dolor = Lorem {
1587 fn lorem<T : Eq>(t : T) {
1588 let lorem : Dolor = Lorem {
1595 See also: [`space_after_colon`](#space_after_colon).
1597 ## `struct_field_align_threshold`
1599 The maximum diff of width between struct fields to be aligned with each other.
1601 - **Default value** : 0
1602 - **Possible values**: any positive integer
1625 ## `spaces_around_ranges`
1627 Put spaces around the .., ..=, and ... range operators
1629 - **Default value**: `false`
1630 - **Possible values**: `true`, `false`
1633 #### `false` (default):
1661 let lorem = 0 .. 10;
1662 let ipsum = 0 ..= 10;
1681 ## `struct_lit_single_line`
1683 Put small struct literals on a single line
1685 - **Default value**: `true`
1686 - **Possible values**: `true`, `false`
1689 #### `true` (default):
1693 let lorem = Lorem { foo: bar, baz: ofo };
1708 See also: [`indent_style`](#indent_style).
1713 Number of spaces per tab
1715 - **Default value**: `4`
1716 - **Possible values**: any positive integer
1723 let ipsum = dolor();
1725 "amet consectetur adipiscing elit amet",
1726 "consectetur adipiscing elit amet consectetur.",
1735 let ipsum = dolor();
1737 "amet consectetur adipiscing elit amet",
1738 "consectetur adipiscing elit amet consectetur.",
1743 See also: [`hard_tabs`](#hard_tabs).
1748 How to handle trailing commas for lists
1750 - **Default value**: `"Vertical"`
1751 - **Possible values**: `"Always"`, `"Never"`, `"Vertical"`
1754 #### `"Vertical"` (default):
1758 let Lorem { ipsum, dolor, sit } = amet;
1774 let Lorem { ipsum, dolor, sit, } = amet;
1790 let Lorem { ipsum, dolor, sit } = amet;
1802 See also: [`match_block_trailing_comma`](#match_block_trailing_comma).
1804 ## `trailing_semicolon`
1806 Add trailing semicolon after break, continue and return
1808 - **Default value**: `true`
1809 - **Possible values**: `true`, `false`
1812 #### `true` (default):
1826 ## `type_punctuation_density`
1828 Determines if `+` or `=` are wrapped in spaces in the punctuation of types
1830 - **Default value**: `"Wide"`
1831 - **Possible values**: `"Compressed"`, `"Wide"`
1834 #### `"Wide"` (default):
1837 fn lorem<Ipsum: Dolor + Sit = Amet>() {
1842 #### `"Compressed"`:
1845 fn lorem<Ipsum: Dolor+Sit=Amet>() {
1850 ## `use_field_init_shorthand`
1852 Use field initialize shorthand if possible.
1854 - **Default value**: `false`
1855 - **Possible values**: `true`, `false`
1858 #### `false` (default):
1871 let a = Foo { x: x, y: y, z: z };
1888 let a = Foo { x, y, z };
1892 ## `use_try_shorthand`
1894 Replace uses of the try! macro by the ? shorthand
1896 - **Default value**: `false`
1897 - **Possible values**: `true`, `false`
1900 #### `false` (default):
1904 let lorem = try!(ipsum.map(|dolor| dolor.sit()));
1912 let lorem = ipsum.map(|dolor| dolor.sit())?;
1919 Break comments to fit on the line
1921 - **Default value**: `false`
1922 - **Possible values**: `true`, `false`
1925 #### `false` (default):
1928 // 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.
1934 // Lorem ipsum dolor sit amet, consectetur adipiscing elit,
1935 // sed do eiusmod tempor incididunt ut labore et dolore
1936 // magna aliqua. Ut enim ad minim veniam, quis nostrud
1937 // exercitation ullamco laboris nisi ut aliquip ex ea
1938 // commodo consequat.
1941 ## `match_arm_blocks`
1943 Wrap the body of arms in blocks when it does not fit on the same line with the pattern of arms
1945 - **Default value**: `true`
1946 - **Possible values**: `true`, `false`
1949 #### `true` (default):
1955 foooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo(x)
1957 false => println!("{}", sit),
1968 foooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo(x),
1969 false => println!("{}", sit),
1974 See also: [`match_block_trailing_comma`](#match_block_trailing_comma).
1977 ## `blank_lines_upper_bound`
1979 Maximum number of blank lines which can be put between items. If more than this number of consecutive empty
1980 lines are found, they are trimmed down to match this integer.
1982 - **Default value**: `1`
1983 - **Possible values**: *unsigned integer*
2034 See also: [`blank_lines_lower_bound`](#blank_lines_lower_bound)
2036 ## `blank_lines_lower_bound`
2038 Minimum number of blank lines which must be put between items. If two items have fewer blank lines between
2039 them, additional blank lines are inserted.
2041 - **Default value**: `0`
2042 - **Possible values**: *unsigned integer*
2046 Original Code (rustfmt will not change it with the default value of `0`):
2076 ## `required_version`
2078 Require a specific version of rustfmt. If you want to make sure that the
2079 specific version of rustfmt is used in your CI, use this option.
2081 - **Default value**: `CARGO_PKG_VERSION`
2082 - **Possible values**: any published version (e.g. `"0.3.8"`)
2085 ## `hide_parse_errors`
2087 Do not show parse errors if the parser failed to parse files.
2089 - **Default value**: `false`
2090 - **Possible values**: `true`, `false`
2095 Whether to use colored output or not.
2097 - **Default value**: `"Auto"`
2098 - **Possible values**: "Auto", "Always", "Never"
2101 ## `unstable_features`
2103 Enable unstable features on stable channel.
2105 - **Default value**: `false`
2106 - **Possible values**: `true`, `false`
2109 ## `license_template_path`
2111 Check whether beginnings of files match a license template.
2113 - **Default value**: `""``
2114 - **Possible values**: path to a license template file
2117 A license template is a plain text file which is matched literally against the
2118 beginning of each source file, except for `{}`-delimited blocks, which are
2119 matched as regular expressions. The following license template therefore
2120 matches strings like `// Copyright 2017 The Rust Project Developers.`, `//
2121 Copyright 2018 The Rust Project Developers.`, etc.:
2124 // Copyright {\d+} The Rust Project Developers.
2127 `\{`, `\}` and `\\` match literal braces / backslashes.
2131 Skip formatting the specified files and directories.
2133 - **Default value**: format every files
2134 - **Possible values**: See an example below
2139 If you want to ignore specific files, put the following to your config file:
2148 If you want to ignore every file under `examples/`, put the following to your config file:
2158 Specifies which edition is used by the parser.
2160 - **Default value**: `Edition2015`
2161 - **Possible values**: `Edition2015`, `Edition2018`
2166 If you want to format code that requires edition 2018, add the following to your config file:
2169 edition = "Edition2018"
2178 Internal option, use `--backup`