]> git.lizzy.rs Git - rust.git/blob - Configurations.md
ff83f02f87ba597bde2f100635372511534faf08
[rust.git] / Configurations.md
1 # Configuring Rustfmt
2
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. If none of these directories contain such a file, both your home directory and a directory called `rustfmt` in your [global config directory](https://docs.rs/dirs/1.0.4/dirs/fn.config_dir.html) (e.g. `.config/rustfmt/`) are checked as well.
4
5 A possible content of `rustfmt.toml` or `.rustfmt.toml` might look like this:
6
7 ```toml
8 indent_style = "Block"
9 reorder_imports = false
10 ```
11
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.
15
16 # Configuration Options
17
18 Below you find a detailed visual guide on all the supported configuration options of rustfmt:
19
20 ## `array_width`
21
22 Maximum width of an array literal before falling back to vertical formatting.
23
24 - **Default value**: `60`
25 - **Possible values**: any positive integer that is less than or equal to the value specified for [`max_width`](#max_width)
26 - **Stable**: Yes
27
28 By default this option is set as a percentage of [`max_width`](#max_width) provided by [`use_small_heuristics`](#use_small_heuristics), but a value set directly for `array_width` will take precedence.
29
30 See also [`max_width`](#max_width) and [`use_small_heuristics`](#use_small_heuristics)
31
32 ## `attr_fn_like_width`
33
34 Maximum width of the args of a function-like attributes before falling back to vertical formatting.
35
36 - **Default value**: `70`
37 - **Possible values**: any positive integer that is less than or equal to the value specified for [`max_width`](#max_width)
38 - **Stable**: Yes
39
40 By default this option is set as a percentage of [`max_width`](#max_width) provided by [`use_small_heuristics`](#use_small_heuristics), but a value set directly for `attr_fn_like_width` will take precedence.
41
42 See also [`max_width`](#max_width) and [`use_small_heuristics`](#use_small_heuristics)
43
44 ## `binop_separator`
45
46 Where to put a binary operator when a binary expression goes multiline.
47
48 - **Default value**: `"Front"`
49 - **Possible values**: `"Front"`, `"Back"`
50 - **Stable**: No (tracking issue: #3368)
51
52 #### `"Front"` (default):
53
54 ```rust
55 fn main() {
56     let or = foofoofoofoofoofoofoofoofoofoofoofoofoofoofoofoo
57         || barbarbarbarbarbarbarbarbarbarbarbarbarbarbarbar;
58
59     let sum = 123456789012345678901234567890
60         + 123456789012345678901234567890
61         + 123456789012345678901234567890;
62
63     let range = aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
64         ..bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb;
65 }
66 ```
67
68 #### `"Back"`:
69
70 ```rust
71 fn main() {
72     let or = foofoofoofoofoofoofoofoofoofoofoofoofoofoofoofoo ||
73         barbarbarbarbarbarbarbarbarbarbarbarbarbarbarbar;
74
75     let sum = 123456789012345678901234567890 +
76         123456789012345678901234567890 +
77         123456789012345678901234567890;
78
79     let range = aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa..
80         bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb;
81 }
82 ```
83
84 ## `blank_lines_lower_bound`
85
86 Minimum number of blank lines which must be put between items. If two items have fewer blank lines between
87 them, additional blank lines are inserted.
88
89 - **Default value**: `0`
90 - **Possible values**: *unsigned integer*
91 - **Stable**: No (tracking issue: #3382)
92
93 ### Example
94 Original Code (rustfmt will not change it with the default value of `0`):
95
96 ```rust
97 #![rustfmt::skip]
98
99 fn foo() {
100     println!("a");
101 }
102 fn bar() {
103     println!("b");
104     println!("c");
105 }
106 ```
107
108 #### `1`
109 ```rust
110 fn foo() {
111
112     println!("a");
113 }
114
115 fn bar() {
116
117     println!("b");
118
119     println!("c");
120 }
121 ```
122
123
124 ## `blank_lines_upper_bound`
125
126 Maximum number of blank lines which can be put between items. If more than this number of consecutive empty
127 lines are found, they are trimmed down to match this integer.
128
129 - **Default value**: `1`
130 - **Possible values**: any non-negative integer
131 - **Stable**: No (tracking issue: #3381)
132
133 ### Example
134 Original Code:
135
136 ```rust
137 #![rustfmt::skip]
138
139 fn foo() {
140     println!("a");
141 }
142
143
144
145 fn bar() {
146     println!("b");
147
148
149     println!("c");
150 }
151 ```
152
153 #### `1` (default):
154 ```rust
155 fn foo() {
156     println!("a");
157 }
158
159 fn bar() {
160     println!("b");
161
162     println!("c");
163 }
164 ```
165
166 #### `2`:
167 ```rust
168 fn foo() {
169     println!("a");
170 }
171
172
173 fn bar() {
174     println!("b");
175
176
177     println!("c");
178 }
179 ```
180
181 See also: [`blank_lines_lower_bound`](#blank_lines_lower_bound)
182
183 ## `brace_style`
184
185 Brace style for items
186
187 - **Default value**: `"SameLineWhere"`
188 - **Possible values**: `"AlwaysNextLine"`, `"PreferSameLine"`, `"SameLineWhere"`
189 - **Stable**: No (tracking issue: #3376)
190
191 ### Functions
192
193 #### `"SameLineWhere"` (default):
194
195 ```rust
196 fn lorem() {
197     // body
198 }
199
200 fn lorem(ipsum: usize) {
201     // body
202 }
203
204 fn lorem<T>(ipsum: T)
205 where
206     T: Add + Sub + Mul + Div,
207 {
208     // body
209 }
210 ```
211
212 #### `"AlwaysNextLine"`:
213
214 ```rust
215 fn lorem()
216 {
217     // body
218 }
219
220 fn lorem(ipsum: usize)
221 {
222     // body
223 }
224
225 fn lorem<T>(ipsum: T)
226 where
227     T: Add + Sub + Mul + Div,
228 {
229     // body
230 }
231 ```
232
233 #### `"PreferSameLine"`:
234
235 ```rust
236 fn lorem() {
237     // body
238 }
239
240 fn lorem(ipsum: usize) {
241     // body
242 }
243
244 fn lorem<T>(ipsum: T)
245 where
246     T: Add + Sub + Mul + Div, {
247     // body
248 }
249 ```
250
251 ### Structs and enums
252
253 #### `"SameLineWhere"` (default):
254
255 ```rust
256 struct Lorem {
257     ipsum: bool,
258 }
259
260 struct Dolor<T>
261 where
262     T: Eq,
263 {
264     sit: T,
265 }
266 ```
267
268 #### `"AlwaysNextLine"`:
269
270 ```rust
271 struct Lorem
272 {
273     ipsum: bool,
274 }
275
276 struct Dolor<T>
277 where
278     T: Eq,
279 {
280     sit: T,
281 }
282 ```
283
284 #### `"PreferSameLine"`:
285
286 ```rust
287 struct Lorem {
288     ipsum: bool,
289 }
290
291 struct Dolor<T>
292 where
293     T: Eq, {
294     sit: T,
295 }
296 ```
297
298 ## `chain_width`
299
300 Maximum width of a chain to fit on one line.
301
302 - **Default value**: `60`
303 - **Possible values**: any positive integer that is less than or equal to the value specified for [`max_width`](#max_width)
304 - **Stable**: Yes
305
306 By default this option is set as a percentage of [`max_width`](#max_width) provided by [`use_small_heuristics`](#use_small_heuristics), but a value set directly for `chain_width` will take precedence.
307
308 See also [`max_width`](#max_width) and [`use_small_heuristics`](#use_small_heuristics)
309
310 ## `color`
311
312 Whether to use colored output or not.
313
314 - **Default value**: `"Auto"`
315 - **Possible values**: "Auto", "Always", "Never"
316 - **Stable**: No (tracking issue: #3385)
317
318 ## `combine_control_expr`
319
320 Combine control expressions with function calls.
321
322 - **Default value**: `true`
323 - **Possible values**: `true`, `false`
324 - **Stable**: No (tracking issue: #3369)
325
326 #### `true` (default):
327
328 ```rust
329 fn example() {
330     // If
331     foo!(if x {
332         foo();
333     } else {
334         bar();
335     });
336
337     // IfLet
338     foo!(if let Some(..) = x {
339         foo();
340     } else {
341         bar();
342     });
343
344     // While
345     foo!(while x {
346         foo();
347         bar();
348     });
349
350     // WhileLet
351     foo!(while let Some(..) = x {
352         foo();
353         bar();
354     });
355
356     // ForLoop
357     foo!(for x in y {
358         foo();
359         bar();
360     });
361
362     // Loop
363     foo!(loop {
364         foo();
365         bar();
366     });
367 }
368 ```
369
370 #### `false`:
371
372 ```rust
373 fn example() {
374     // If
375     foo!(
376         if x {
377             foo();
378         } else {
379             bar();
380         }
381     );
382
383     // IfLet
384     foo!(
385         if let Some(..) = x {
386             foo();
387         } else {
388             bar();
389         }
390     );
391
392     // While
393     foo!(
394         while x {
395             foo();
396             bar();
397         }
398     );
399
400     // WhileLet
401     foo!(
402         while let Some(..) = x {
403             foo();
404             bar();
405         }
406     );
407
408     // ForLoop
409     foo!(
410         for x in y {
411             foo();
412             bar();
413         }
414     );
415
416     // Loop
417     foo!(
418         loop {
419             foo();
420             bar();
421         }
422     );
423 }
424 ```
425
426 ## `comment_width`
427
428 Maximum length of comments. No effect unless`wrap_comments = true`.
429
430 - **Default value**: `80`
431 - **Possible values**: any positive integer
432 - **Stable**: No (tracking issue: #3349)
433
434 **Note:** A value of `0` results in [`wrap_comments`](#wrap_comments) being applied regardless of a line's width.
435
436 #### `80` (default; comments shorter than `comment_width`):
437 ```rust
438 // Lorem ipsum dolor sit amet, consectetur adipiscing elit.
439 ```
440
441 #### `60` (comments longer than `comment_width`):
442 ```rust
443 // Lorem ipsum dolor sit amet,
444 // consectetur adipiscing elit.
445 ```
446
447 See also [`wrap_comments`](#wrap_comments).
448
449 ## `condense_wildcard_suffixes`
450
451 Replace strings of _ wildcards by a single .. in tuple patterns
452
453 - **Default value**: `false`
454 - **Possible values**: `true`, `false`
455 - **Stable**: No (tracking issue: #3384)
456
457 #### `false` (default):
458
459 ```rust
460 fn main() {
461     let (lorem, ipsum, _, _) = (1, 2, 3, 4);
462     let (lorem, ipsum, ..) = (1, 2, 3, 4);
463 }
464 ```
465
466 #### `true`:
467
468 ```rust
469 fn main() {
470     let (lorem, ipsum, ..) = (1, 2, 3, 4);
471 }
472 ```
473
474 ## `control_brace_style`
475
476 Brace style for control flow constructs
477
478 - **Default value**: `"AlwaysSameLine"`
479 - **Possible values**: `"AlwaysNextLine"`, `"AlwaysSameLine"`, `"ClosingNextLine"`
480 - **Stable**: No (tracking issue: #3377)
481
482 #### `"AlwaysSameLine"` (default):
483
484 ```rust
485 fn main() {
486     if lorem {
487         println!("ipsum!");
488     } else {
489         println!("dolor!");
490     }
491 }
492 ```
493
494 #### `"AlwaysNextLine"`:
495
496 ```rust
497 fn main() {
498     if lorem
499     {
500         println!("ipsum!");
501     }
502     else
503     {
504         println!("dolor!");
505     }
506 }
507 ```
508
509 #### `"ClosingNextLine"`:
510
511 ```rust
512 fn main() {
513     if lorem {
514         println!("ipsum!");
515     }
516     else {
517         println!("dolor!");
518     }
519 }
520 ```
521
522 ## `disable_all_formatting`
523
524 Don't reformat anything
525
526 - **Default value**: `false`
527 - **Possible values**: `true`, `false`
528 - **Stable**: No (tracking issue: #3388)
529
530 ## `edition`
531
532 Specifies which edition is used by the parser.
533
534 - **Default value**: `"2015"`
535 - **Possible values**: `"2015"`, `"2018"`, `"2021"`
536 - **Stable**: Yes
537
538 Rustfmt is able to pick up the edition used by reading the `Cargo.toml` file if executed
539 through the Cargo's formatting tool `cargo fmt`. Otherwise, the edition needs to be specified
540 in your config file:
541
542 ```toml
543 edition = "2018"
544 ```
545
546 ## `empty_item_single_line`
547
548 Put empty-body functions and impls on a single line
549
550 - **Default value**: `true`
551 - **Possible values**: `true`, `false`
552 - **Stable**: No (tracking issue: #3356)
553
554 #### `true` (default):
555
556 ```rust
557 fn lorem() {}
558
559 impl Lorem {}
560 ```
561
562 #### `false`:
563
564 ```rust
565 fn lorem() {
566 }
567
568 impl Lorem {
569 }
570 ```
571
572 See also [`brace_style`](#brace_style), [`control_brace_style`](#control_brace_style).
573
574
575 ## `enum_discrim_align_threshold`
576
577 The maximum length of enum variant having discriminant, that gets vertically aligned with others.
578 Variants without discriminants would be ignored for the purpose of alignment.
579
580 Note that this is not how much whitespace is inserted, but instead the longest variant name that
581 doesn't get ignored when aligning.
582
583 - **Default value** : 0
584 - **Possible values**: any positive integer
585 - **Stable**: No (tracking issue: #3372)
586
587 #### `0` (default):
588
589 ```rust
590 enum Bar {
591     A = 0,
592     Bb = 1,
593     RandomLongVariantGoesHere = 10,
594     Ccc = 71,
595 }
596
597 enum Bar {
598     VeryLongVariantNameHereA = 0,
599     VeryLongVariantNameHereBb = 1,
600     VeryLongVariantNameHereCcc = 2,
601 }
602 ```
603
604 #### `20`:
605
606 ```rust
607 enum Foo {
608     A   = 0,
609     Bb  = 1,
610     RandomLongVariantGoesHere = 10,
611     Ccc = 2,
612 }
613
614 enum Bar {
615     VeryLongVariantNameHereA = 0,
616     VeryLongVariantNameHereBb = 1,
617     VeryLongVariantNameHereCcc = 2,
618 }
619 ```
620
621
622 ## `error_on_line_overflow`
623
624 Error if Rustfmt is unable to get all lines within `max_width`, except for comments and string
625 literals. If this happens, then it is a bug in Rustfmt. You might be able to work around the bug by
626 refactoring your code to avoid long/complex expressions, usually by extracting a local variable or
627 using a shorter name.
628
629 - **Default value**: `false`
630 - **Possible values**: `true`, `false`
631 - **Stable**: No (tracking issue: #3391)
632
633 See also [`max_width`](#max_width).
634
635 ## `error_on_unformatted`
636
637 Error if unable to get comments or string literals within `max_width`, or they are left with
638 trailing whitespaces.
639
640 - **Default value**: `false`
641 - **Possible values**: `true`, `false`
642 - **Stable**: No (tracking issue: #3392)
643
644 ## `fn_args_layout`
645
646 Control the layout of arguments in a function
647
648 - **Default value**: `"Tall"`
649 - **Possible values**: `"Compressed"`, `"Tall"`, `"Vertical"`
650 - **Stable**: Yes
651
652 #### `"Tall"` (default):
653
654 ```rust
655 trait Lorem {
656     fn lorem(ipsum: Ipsum, dolor: Dolor, sit: Sit, amet: Amet);
657
658     fn lorem(ipsum: Ipsum, dolor: Dolor, sit: Sit, amet: Amet) {
659         // body
660     }
661
662     fn lorem(
663         ipsum: Ipsum,
664         dolor: Dolor,
665         sit: Sit,
666         amet: Amet,
667         consectetur: Consectetur,
668         adipiscing: Adipiscing,
669         elit: Elit,
670     );
671
672     fn lorem(
673         ipsum: Ipsum,
674         dolor: Dolor,
675         sit: Sit,
676         amet: Amet,
677         consectetur: Consectetur,
678         adipiscing: Adipiscing,
679         elit: Elit,
680     ) {
681         // body
682     }
683 }
684 ```
685
686 #### `"Compressed"`:
687
688 ```rust
689 trait Lorem {
690     fn lorem(ipsum: Ipsum, dolor: Dolor, sit: Sit, amet: Amet);
691
692     fn lorem(ipsum: Ipsum, dolor: Dolor, sit: Sit, amet: Amet) {
693         // body
694     }
695
696     fn lorem(
697         ipsum: Ipsum, dolor: Dolor, sit: Sit, amet: Amet, consectetur: Consectetur,
698         adipiscing: Adipiscing, elit: Elit,
699     );
700
701     fn lorem(
702         ipsum: Ipsum, dolor: Dolor, sit: Sit, amet: Amet, consectetur: Consectetur,
703         adipiscing: Adipiscing, elit: Elit,
704     ) {
705         // body
706     }
707 }
708 ```
709
710 #### `"Vertical"`:
711
712 ```rust
713 trait Lorem {
714     fn lorem(
715         ipsum: Ipsum,
716         dolor: Dolor,
717         sit: Sit,
718         amet: Amet,
719     );
720
721     fn lorem(
722         ipsum: Ipsum,
723         dolor: Dolor,
724         sit: Sit,
725         amet: Amet,
726     ) {
727         // body
728     }
729
730     fn lorem(
731         ipsum: Ipsum,
732         dolor: Dolor,
733         sit: Sit,
734         amet: Amet,
735         consectetur: Consectetur,
736         adipiscing: Adipiscing,
737         elit: Elit,
738     );
739
740     fn lorem(
741         ipsum: Ipsum,
742         dolor: Dolor,
743         sit: Sit,
744         amet: Amet,
745         consectetur: Consectetur,
746         adipiscing: Adipiscing,
747         elit: Elit,
748     ) {
749         // body
750     }
751 }
752 ```
753
754 ## `fn_call_width`
755
756 Maximum width of the args of a function call before falling back to vertical formatting.
757
758 - **Default value**: `60`
759 - **Possible values**: any positive integer that is less than or equal to the value specified for [`max_width`](#max_width)
760 - **Stable**: Yes
761
762 By default this option is set as a percentage of [`max_width`](#max_width) provided by [`use_small_heuristics`](#use_small_heuristics), but a value set directly for `fn_call_width` will take precedence.
763
764 See also [`max_width`](#max_width) and [`use_small_heuristics`](#use_small_heuristics)
765
766 ## `fn_single_line`
767
768 Put single-expression functions on a single line
769
770 - **Default value**: `false`
771 - **Possible values**: `true`, `false`
772 - **Stable**: No (tracking issue: #3358)
773
774 #### `false` (default):
775
776 ```rust
777 fn lorem() -> usize {
778     42
779 }
780
781 fn lorem() -> usize {
782     let ipsum = 42;
783     ipsum
784 }
785 ```
786
787 #### `true`:
788
789 ```rust
790 fn lorem() -> usize { 42 }
791
792 fn lorem() -> usize {
793     let ipsum = 42;
794     ipsum
795 }
796 ```
797
798 See also [`control_brace_style`](#control_brace_style).
799
800
801 ## `force_explicit_abi`
802
803 Always print the abi for extern items
804
805 - **Default value**: `true`
806 - **Possible values**: `true`, `false`
807 - **Stable**: Yes
808
809 **Note:** Non-"C" ABIs are always printed. If `false` then "C" is removed.
810
811 #### `true` (default):
812
813 ```rust
814 extern "C" {
815     pub static lorem: c_int;
816 }
817 ```
818
819 #### `false`:
820
821 ```rust
822 extern {
823     pub static lorem: c_int;
824 }
825 ```
826
827 ## `force_multiline_blocks`
828
829 Force multiline closure and match arm bodies to be wrapped in a block
830
831 - **Default value**: `false`
832 - **Possible values**: `false`, `true`
833 - **Stable**: No (tracking issue: #3374)
834
835 #### `false` (default):
836
837 ```rust
838 fn main() {
839     result.and_then(|maybe_value| match maybe_value {
840         None => foo(),
841         Some(value) => bar(),
842     });
843
844     match lorem {
845         None => |ipsum| {
846             println!("Hello World");
847         },
848         Some(dolor) => foo(),
849     }
850 }
851 ```
852
853 #### `true`:
854
855 ```rust
856 fn main() {
857     result.and_then(|maybe_value| {
858         match maybe_value {
859             None => foo(),
860             Some(value) => bar(),
861         }
862     });
863
864     match lorem {
865         None => {
866             |ipsum| {
867                 println!("Hello World");
868             }
869         }
870         Some(dolor) => foo(),
871     }
872 }
873 ```
874
875
876 ## `format_code_in_doc_comments`
877
878 Format code snippet included in doc comments.
879
880 - **Default value**: `false`
881 - **Possible values**: `true`, `false`
882 - **Stable**: No (tracking issue: #3348)
883
884 #### `false` (default):
885
886 ```rust
887 /// Adds one to the number given.
888 ///
889 /// # Examples
890 ///
891 /// ```rust
892 /// let five=5;
893 ///
894 /// assert_eq!(
895 ///     6,
896 ///     add_one(5)
897 /// );
898 /// # fn add_one(x: i32) -> i32 {
899 /// #     x + 1
900 /// # }
901 /// ```
902 fn add_one(x: i32) -> i32 {
903     x + 1
904 }
905 ```
906
907 #### `true`
908
909 ```rust
910 /// Adds one to the number given.
911 ///
912 /// # Examples
913 ///
914 /// ```rust
915 /// let five = 5;
916 ///
917 /// assert_eq!(6, add_one(5));
918 /// # fn add_one(x: i32) -> i32 {
919 /// #     x + 1
920 /// # }
921 /// ```
922 fn add_one(x: i32) -> i32 {
923     x + 1
924 }
925 ```
926
927 ## `format_generated_files`
928
929 Format generated files. A file is considered generated
930 if any of the first five lines contains `@generated` marker.
931
932 - **Default value**: `false`
933 - **Possible values**: `true`, `false`
934 - **Stable**: No
935
936 ## `format_macro_matchers`
937
938 Format the metavariable matching patterns in macros.
939
940 - **Default value**: `false`
941 - **Possible values**: `true`, `false`
942 - **Stable**: No (tracking issue: #3354)
943
944 #### `false` (default):
945
946 ```rust
947 macro_rules! foo {
948     ($a: ident : $b: ty) => {
949         $a(42): $b;
950     };
951     ($a: ident $b: ident $c: ident) => {
952         $a = $b + $c;
953     };
954 }
955 ```
956
957 #### `true`:
958
959 ```rust
960 macro_rules! foo {
961     ($a:ident : $b:ty) => {
962         $a(42): $b;
963     };
964     ($a:ident $b:ident $c:ident) => {
965         $a = $b + $c;
966     };
967 }
968 ```
969
970 See also [`format_macro_bodies`](#format_macro_bodies).
971
972
973 ## `format_macro_bodies`
974
975 Format the bodies of macros.
976
977 - **Default value**: `true`
978 - **Possible values**: `true`, `false`
979 - **Stable**: No (tracking issue: #3355)
980
981 #### `true` (default):
982
983 ```rust
984 macro_rules! foo {
985     ($a: ident : $b: ty) => {
986         $a(42): $b;
987     };
988     ($a: ident $b: ident $c: ident) => {
989         $a = $b + $c;
990     };
991 }
992 ```
993
994 #### `false`:
995
996 ```rust
997 macro_rules! foo {
998     ($a: ident : $b: ty) => { $a(42): $b; };
999     ($a: ident $b: ident $c: ident) => { $a=$b+$c; };
1000 }
1001 ```
1002
1003 See also [`format_macro_matchers`](#format_macro_matchers).
1004
1005
1006 ## `format_strings`
1007
1008 Format string literals where necessary
1009
1010 - **Default value**: `false`
1011 - **Possible values**: `true`, `false`
1012 - **Stable**: No (tracking issue: #3353)
1013
1014 #### `false` (default):
1015
1016 ```rust
1017 fn main() {
1018     let lorem = "ipsum dolor sit amet consectetur adipiscing elit lorem ipsum dolor sit amet consectetur adipiscing";
1019 }
1020 ```
1021
1022 #### `true`:
1023
1024 ```rust
1025 fn main() {
1026     let lorem = "ipsum dolor sit amet consectetur adipiscing elit lorem ipsum dolor sit amet \
1027                  consectetur adipiscing";
1028 }
1029 ```
1030
1031 See also [`max_width`](#max_width).
1032
1033 ## `hard_tabs`
1034
1035 Use tab characters for indentation, spaces for alignment
1036
1037 - **Default value**: `false`
1038 - **Possible values**: `true`, `false`
1039 - **Stable**: Yes
1040
1041 #### `false` (default):
1042
1043 ```rust
1044 fn lorem() -> usize {
1045     42 // spaces before 42
1046 }
1047 ```
1048
1049 #### `true`:
1050
1051 ```rust
1052 fn lorem() -> usize {
1053         42 // tabs before 42
1054 }
1055 ```
1056
1057 See also: [`tab_spaces`](#tab_spaces).
1058
1059 ## `hex_literal_case`
1060
1061 Control the case of the letters in hexadecimal literal values
1062
1063 - **Default value**: `Preserve`
1064 - **Possible values**: `Upper`, `Lower`
1065 - **Stable**: No
1066
1067 ## `hide_parse_errors`
1068
1069 Do not show parse errors if the parser failed to parse files.
1070
1071 - **Default value**: `false`
1072 - **Possible values**: `true`, `false`
1073 - **Stable**: No (tracking issue: #3390)
1074
1075 ## `ignore`
1076
1077 Skip formatting files and directories that match the specified pattern.
1078 The pattern format is the same as [.gitignore](https://git-scm.com/docs/gitignore#_pattern_format). Be sure to use Unix/forwardslash `/` style  paths. This path style will work on all platforms. Windows style paths with backslashes `\` are not supported.
1079
1080 - **Default value**: format every file
1081 - **Possible values**: See an example below
1082 - **Stable**: No (tracking issue: #3395)
1083
1084 ### Example
1085
1086 If you want to ignore specific files, put the following to your config file:
1087
1088 ```toml
1089 ignore = [
1090     "src/types.rs",
1091     "src/foo/bar.rs",
1092 ]
1093 ```
1094
1095 If you want to ignore every file under `examples/`, put the following to your config file:
1096
1097 ```toml
1098 ignore = [
1099     "examples",
1100 ]
1101 ```
1102
1103 If you want to ignore every file under the directory where you put your rustfmt.toml:
1104
1105 ```toml
1106 ignore = ["/"]
1107 ```
1108
1109 ## `imports_indent`
1110
1111 Indent style of imports
1112
1113 - **Default Value**: `"Block"`
1114 - **Possible values**: `"Block"`, `"Visual"`
1115 - **Stable**: No (tracking issue: #3360)
1116
1117 #### `"Block"` (default):
1118
1119 ```rust
1120 use foo::{
1121     xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx, yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy,
1122     zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz,
1123 };
1124 ```
1125
1126 #### `"Visual"`:
1127
1128 ```rust
1129 use foo::{xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx, yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy,
1130           zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz};
1131 ```
1132
1133 See also: [`imports_layout`](#imports_layout).
1134
1135 ## `imports_layout`
1136
1137 Item layout inside a imports block
1138
1139 - **Default value**: "Mixed"
1140 - **Possible values**: "Horizontal", "HorizontalVertical", "Mixed", "Vertical"
1141 - **Stable**: No (tracking issue: #3361)
1142
1143 #### `"Mixed"` (default):
1144
1145 ```rust
1146 use foo::{xxxxxxxxxxxxxxxxxx, yyyyyyyyyyyyyyyyyy, zzzzzzzzzzzzzzzzzz};
1147
1148 use foo::{
1149     aaaaaaaaaaaaaaaaaa, bbbbbbbbbbbbbbbbbb, cccccccccccccccccc, dddddddddddddddddd,
1150     eeeeeeeeeeeeeeeeee, ffffffffffffffffff,
1151 };
1152 ```
1153
1154 #### `"Horizontal"`:
1155
1156 **Note**: This option forces all imports onto one line and may exceed `max_width`.
1157
1158 ```rust
1159 use foo::{xxx, yyy, zzz};
1160
1161 use foo::{aaa, bbb, ccc, ddd, eee, fff};
1162 ```
1163
1164 #### `"HorizontalVertical"`:
1165
1166 ```rust
1167 use foo::{xxxxxxxxxxxxxxxxxx, yyyyyyyyyyyyyyyyyy, zzzzzzzzzzzzzzzzzz};
1168
1169 use foo::{
1170     aaaaaaaaaaaaaaaaaa,
1171     bbbbbbbbbbbbbbbbbb,
1172     cccccccccccccccccc,
1173     dddddddddddddddddd,
1174     eeeeeeeeeeeeeeeeee,
1175     ffffffffffffffffff,
1176 };
1177 ```
1178
1179 #### `"Vertical"`:
1180
1181 ```rust
1182 use foo::{
1183     xxx,
1184     yyy,
1185     zzz,
1186 };
1187
1188 use foo::{
1189     aaa,
1190     bbb,
1191     ccc,
1192     ddd,
1193     eee,
1194     fff,
1195 };
1196 ```
1197
1198 ## `indent_style`
1199
1200 Indent on expressions or items.
1201
1202 - **Default value**: `"Block"`
1203 - **Possible values**: `"Block"`, `"Visual"`
1204 - **Stable**: No (tracking issue: #3346)
1205
1206 ### Array
1207
1208 #### `"Block"` (default):
1209
1210 ```rust
1211 fn main() {
1212     let lorem = vec![
1213         "ipsum",
1214         "dolor",
1215         "sit",
1216         "amet",
1217         "consectetur",
1218         "adipiscing",
1219         "elit",
1220     ];
1221 }
1222 ```
1223
1224 #### `"Visual"`:
1225
1226 ```rust
1227 fn main() {
1228     let lorem = vec!["ipsum",
1229                      "dolor",
1230                      "sit",
1231                      "amet",
1232                      "consectetur",
1233                      "adipiscing",
1234                      "elit"];
1235 }
1236 ```
1237
1238 ### Control flow
1239
1240 #### `"Block"` (default):
1241
1242 ```rust
1243 fn main() {
1244     if lorem_ipsum
1245         && dolor_sit
1246         && amet_consectetur
1247         && lorem_sit
1248         && dolor_consectetur
1249         && amet_ipsum
1250         && lorem_consectetur
1251     {
1252         // ...
1253     }
1254 }
1255 ```
1256
1257 #### `"Visual"`:
1258
1259 ```rust
1260 fn main() {
1261     if lorem_ipsum
1262        && dolor_sit
1263        && amet_consectetur
1264        && lorem_sit
1265        && dolor_consectetur
1266        && amet_ipsum
1267        && lorem_consectetur
1268     {
1269         // ...
1270     }
1271 }
1272 ```
1273
1274 See also: [`control_brace_style`](#control_brace_style).
1275
1276 ### Function arguments
1277
1278 #### `"Block"` (default):
1279
1280 ```rust
1281 fn lorem() {}
1282
1283 fn lorem(ipsum: usize) {}
1284
1285 fn lorem(
1286     ipsum: usize,
1287     dolor: usize,
1288     sit: usize,
1289     amet: usize,
1290     consectetur: usize,
1291     adipiscing: usize,
1292     elit: usize,
1293 ) {
1294     // body
1295 }
1296 ```
1297
1298 #### `"Visual"`:
1299
1300 ```rust
1301 fn lorem() {}
1302
1303 fn lorem(ipsum: usize) {}
1304
1305 fn lorem(ipsum: usize,
1306          dolor: usize,
1307          sit: usize,
1308          amet: usize,
1309          consectetur: usize,
1310          adipiscing: usize,
1311          elit: usize) {
1312     // body
1313 }
1314 ```
1315
1316 ### Function calls
1317
1318 #### `"Block"` (default):
1319
1320 ```rust
1321 fn main() {
1322     lorem(
1323         "lorem",
1324         "ipsum",
1325         "dolor",
1326         "sit",
1327         "amet",
1328         "consectetur",
1329         "adipiscing",
1330         "elit",
1331     );
1332 }
1333 ```
1334
1335 #### `"Visual"`:
1336
1337 ```rust
1338 fn main() {
1339     lorem("lorem",
1340           "ipsum",
1341           "dolor",
1342           "sit",
1343           "amet",
1344           "consectetur",
1345           "adipiscing",
1346           "elit");
1347 }
1348 ```
1349
1350 ### Generics
1351
1352 #### `"Block"` (default):
1353
1354 ```rust
1355 fn lorem<
1356     Ipsum: Eq = usize,
1357     Dolor: Eq = usize,
1358     Sit: Eq = usize,
1359     Amet: Eq = usize,
1360     Adipiscing: Eq = usize,
1361     Consectetur: Eq = usize,
1362     Elit: Eq = usize,
1363 >(
1364     ipsum: Ipsum,
1365     dolor: Dolor,
1366     sit: Sit,
1367     amet: Amet,
1368     adipiscing: Adipiscing,
1369     consectetur: Consectetur,
1370     elit: Elit,
1371 ) -> T {
1372     // body
1373 }
1374 ```
1375
1376 #### `"Visual"`:
1377
1378 ```rust
1379 fn lorem<Ipsum: Eq = usize,
1380          Dolor: Eq = usize,
1381          Sit: Eq = usize,
1382          Amet: Eq = usize,
1383          Adipiscing: Eq = usize,
1384          Consectetur: Eq = usize,
1385          Elit: Eq = usize>(
1386     ipsum: Ipsum,
1387     dolor: Dolor,
1388     sit: Sit,
1389     amet: Amet,
1390     adipiscing: Adipiscing,
1391     consectetur: Consectetur,
1392     elit: Elit)
1393     -> T {
1394     // body
1395 }
1396 ```
1397
1398 #### Struct
1399
1400 #### `"Block"` (default):
1401
1402 ```rust
1403 fn main() {
1404     let lorem = Lorem {
1405         ipsum: dolor,
1406         sit: amet,
1407     };
1408 }
1409 ```
1410
1411 #### `"Visual"`:
1412
1413 ```rust
1414 fn main() {
1415     let lorem = Lorem { ipsum: dolor,
1416                         sit: amet };
1417 }
1418 ```
1419
1420 See also: [`struct_lit_single_line`](#struct_lit_single_line), [`indent_style`](#indent_style).
1421
1422 ### Where predicates
1423
1424 #### `"Block"` (default):
1425
1426 ```rust
1427 fn lorem<Ipsum, Dolor, Sit, Amet>() -> T
1428 where
1429     Ipsum: Eq,
1430     Dolor: Eq,
1431     Sit: Eq,
1432     Amet: Eq,
1433 {
1434     // body
1435 }
1436 ```
1437
1438 #### `"Visual"`:
1439
1440 ```rust
1441 fn lorem<Ipsum, Dolor, Sit, Amet>() -> T
1442     where Ipsum: Eq,
1443           Dolor: Eq,
1444           Sit: Eq,
1445           Amet: Eq
1446 {
1447     // body
1448 }
1449 ```
1450
1451 ## `inline_attribute_width`
1452
1453 Write an item and its attribute on the same line if their combined width is below a threshold
1454
1455 - **Default value**: 0
1456 - **Possible values**: any positive integer
1457 - **Stable**: No (tracking issue: #3343)
1458
1459 ### Example
1460
1461 #### `0` (default):
1462 ```rust
1463 #[cfg(feature = "alloc")]
1464 use core::slice;
1465 ```
1466
1467 #### `50`:
1468 ```rust
1469 #[cfg(feature = "alloc")] use core::slice;
1470 ```
1471
1472 ## `license_template_path`
1473
1474 Check whether beginnings of files match a license template.
1475
1476 - **Default value**: `""`
1477 - **Possible values**: path to a license template file
1478 - **Stable**: No (tracking issue: #3352)
1479
1480 A license template is a plain text file which is matched literally against the
1481 beginning of each source file, except for `{}`-delimited blocks, which are
1482 matched as regular expressions. The following license template therefore
1483 matches strings like `// Copyright 2017 The Rust Project Developers.`, `//
1484 Copyright 2018 The Rust Project Developers.`, etc.:
1485
1486 ```
1487 // Copyright {\d+} The Rust Project Developers.
1488 ```
1489
1490 `\{`, `\}` and `\\` match literal braces / backslashes.
1491
1492 ## `match_arm_blocks`
1493
1494 Controls whether arm bodies are wrapped in cases where the first line of the body cannot fit on the same line as the `=>` operator.
1495
1496 The Style Guide requires that bodies are block wrapped by default if a line break is required after the `=>`, but this option can be used to disable that behavior to prevent wrapping arm bodies in that event, so long as the body does not contain multiple statements nor line comments.
1497
1498 - **Default value**: `true`
1499 - **Possible values**: `true`, `false`
1500 - **Stable**: No (tracking issue: #3373)
1501
1502 #### `true` (default):
1503
1504 ```rust
1505 fn main() {
1506     match lorem {
1507         ipsum => {
1508             foooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo(x)
1509         }
1510         dolor => println!("{}", sit),
1511         sit => foo(
1512             "foooooooooooooooooooooooo",
1513             "baaaaaaaaaaaaaaaaaaaaaaaarr",
1514             "baaaaaaaaaaaaaaaaaaaazzzzzzzzzzzzz",
1515             "qqqqqqqqquuuuuuuuuuuuuuuuuuuuuuuuuuxxx",
1516         ),
1517     }
1518 }
1519 ```
1520
1521 #### `false`:
1522
1523 ```rust
1524 fn main() {
1525     match lorem {
1526         lorem =>
1527             foooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo(x),
1528         ipsum => println!("{}", sit),
1529         sit => foo(
1530             "foooooooooooooooooooooooo",
1531             "baaaaaaaaaaaaaaaaaaaaaaaarr",
1532             "baaaaaaaaaaaaaaaaaaaazzzzzzzzzzzzz",
1533             "qqqqqqqqquuuuuuuuuuuuuuuuuuuuuuuuuuxxx",
1534         ),
1535     }
1536 }
1537 ```
1538
1539 See also: [`match_block_trailing_comma`](#match_block_trailing_comma).
1540
1541 ## `match_arm_leading_pipes`
1542
1543 Controls whether to include a leading pipe on match arms
1544
1545 - **Default value**: `Never`
1546 - **Possible values**: `Always`, `Never`, `Preserve`
1547 - **Stable**: Yes
1548
1549 #### `Never` (default):
1550 ```rust
1551 // Leading pipes are removed from this:
1552 // fn foo() {
1553 //     match foo {
1554 //         | "foo" | "bar" => {}
1555 //         | "baz"
1556 //         | "something relatively long"
1557 //         | "something really really really realllllllllllllly long" => println!("x"),
1558 //         | "qux" => println!("y"),
1559 //         _ => {}
1560 //     }
1561 // }
1562
1563 // Becomes
1564 fn foo() {
1565     match foo {
1566         "foo" | "bar" => {}
1567         "baz"
1568         | "something relatively long"
1569         | "something really really really realllllllllllllly long" => println!("x"),
1570         "qux" => println!("y"),
1571         _ => {}
1572     }
1573 }
1574 ```
1575
1576 #### `Always`:
1577 ```rust
1578 // Leading pipes are emitted on all arms of this:
1579 // fn foo() {
1580 //     match foo {
1581 //         "foo" | "bar" => {}
1582 //         "baz"
1583 //         | "something relatively long"
1584 //         | "something really really really realllllllllllllly long" => println!("x"),
1585 //         "qux" => println!("y"),
1586 //         _ => {}
1587 //     }
1588 // }
1589
1590 // Becomes:
1591 fn foo() {
1592     match foo {
1593         | "foo" | "bar" => {}
1594         | "baz"
1595         | "something relatively long"
1596         | "something really really really realllllllllllllly long" => println!("x"),
1597         | "qux" => println!("y"),
1598         | _ => {}
1599     }
1600 }
1601 ```
1602
1603 #### `Preserve`:
1604 ```rust
1605 fn foo() {
1606     match foo {
1607         | "foo" | "bar" => {}
1608         | "baz"
1609         | "something relatively long"
1610         | "something really really really realllllllllllllly long" => println!("x"),
1611         | "qux" => println!("y"),
1612         _ => {}
1613     }
1614
1615     match baz {
1616         "qux" => {}
1617         "foo" | "bar" => {}
1618         _ => {}
1619     }
1620 }
1621 ```
1622
1623 ## `match_block_trailing_comma`
1624
1625 Put a trailing comma after a block based match arm (non-block arms are not affected)
1626
1627 - **Default value**: `false`
1628 - **Possible values**: `true`, `false`
1629 - **Stable**: No (tracking issue: #3380)
1630
1631 #### `false` (default):
1632
1633 ```rust
1634 fn main() {
1635     match lorem {
1636         Lorem::Ipsum => {
1637             println!("ipsum");
1638         }
1639         Lorem::Dolor => println!("dolor"),
1640     }
1641 }
1642 ```
1643
1644 #### `true`:
1645
1646 ```rust
1647 fn main() {
1648     match lorem {
1649         Lorem::Ipsum => {
1650             println!("ipsum");
1651         },
1652         Lorem::Dolor => println!("dolor"),
1653     }
1654 }
1655 ```
1656
1657 See also: [`trailing_comma`](#trailing_comma), [`match_arm_blocks`](#match_arm_blocks).
1658
1659 ## `max_width`
1660
1661 Maximum width of each line
1662
1663 - **Default value**: `100`
1664 - **Possible values**: any positive integer
1665 - **Stable**: Yes
1666
1667 See also [`error_on_line_overflow`](#error_on_line_overflow).
1668
1669 ## `merge_derives`
1670
1671 Merge multiple derives into a single one.
1672
1673 - **Default value**: `true`
1674 - **Possible values**: `true`, `false`
1675 - **Stable**: Yes
1676
1677 #### `true` (default):
1678
1679 ```rust
1680 #[derive(Eq, PartialEq, Debug, Copy, Clone)]
1681 pub enum Foo {}
1682 ```
1683
1684 #### `false`:
1685
1686 ```rust
1687 #[derive(Eq, PartialEq, Debug, Copy, Clone)]
1688 pub enum Bar {}
1689
1690 #[derive(Eq, PartialEq)]
1691 #[derive(Debug)]
1692 #[derive(Copy, Clone)]
1693 pub enum Foo {}
1694 ```
1695
1696 ## `imports_granularity`
1697
1698 How imports should be grouped into `use` statements. Imports will be merged or split to the configured level of granularity.
1699
1700 - **Default value**: `Preserve`
1701 - **Possible values**: `Preserve`, `Crate`, `Module`, `Item`, `One`
1702 - **Stable**: No
1703
1704 #### `Preserve` (default):
1705
1706 Do not change the granularity of any imports and preserve the original structure written by the developer.
1707
1708 ```rust
1709 use foo::b;
1710 use foo::b::{f, g};
1711 use foo::{a, c, d::e};
1712 use qux::{h, i};
1713 ```
1714
1715 #### `Crate`:
1716
1717 Merge imports from the same crate into a single `use` statement. Conversely, imports from different crates are split into separate statements.
1718
1719 ```rust
1720 use foo::{
1721     a, b,
1722     b::{f, g},
1723     c,
1724     d::e,
1725 };
1726 use qux::{h, i};
1727 ```
1728
1729 #### `Module`:
1730
1731 Merge imports from the same module into a single `use` statement. Conversely, imports from different modules are split into separate statements.
1732
1733 ```rust
1734 use foo::b::{f, g};
1735 use foo::d::e;
1736 use foo::{a, b, c};
1737 use qux::{h, i};
1738 ```
1739
1740 #### `Item`:
1741
1742 Flatten imports so that each has its own `use` statement.
1743
1744 ```rust
1745 use foo::a;
1746 use foo::b;
1747 use foo::b::f;
1748 use foo::b::g;
1749 use foo::c;
1750 use foo::d::e;
1751 use qux::h;
1752 use qux::i;
1753 ```
1754
1755 #### `One`:
1756
1757 Merge all imports into a single `use` statement as long as they have the same visibility.
1758
1759 ```rust
1760 pub use foo::{x, y};
1761 use {
1762     bar::{
1763         a,
1764         b::{self, f, g},
1765         c,
1766         d::e,
1767     },
1768     qux::{h, i},
1769 };
1770 ```
1771
1772 ## `merge_imports`
1773
1774 This option is deprecated. Use `imports_granularity = "Crate"` instead.
1775
1776 - **Default value**: `false`
1777 - **Possible values**: `true`, `false`
1778
1779 #### `false` (default):
1780
1781 ```rust
1782 use foo::{a, c, d};
1783 use foo::{b, g};
1784 use foo::{e, f};
1785 ```
1786
1787 #### `true`:
1788
1789 ```rust
1790 use foo::{a, b, c, d, e, f, g};
1791 ```
1792
1793
1794 ## `newline_style`
1795
1796 Unix or Windows line endings
1797
1798 - **Default value**: `"Auto"`
1799 - **Possible values**: `"Auto"`, `"Native"`, `"Unix"`, `"Windows"`
1800 - **Stable**: Yes
1801
1802 #### `Auto` (default):
1803
1804 The newline style is detected automatically on a per-file basis. Files
1805 with mixed line endings will be converted to the first detected line
1806 ending style.
1807
1808 #### `Native`
1809
1810 Line endings will be converted to `\r\n` on Windows and `\n` on all
1811 other platforms.
1812
1813 #### `Unix`
1814
1815 Line endings will be converted to `\n`.
1816
1817 #### `Windows`
1818
1819 Line endings will be converted to `\r\n`.
1820
1821 ## `normalize_comments`
1822
1823 Convert /* */ comments to // comments where possible
1824
1825 - **Default value**: `false`
1826 - **Possible values**: `true`, `false`
1827 - **Stable**: No (tracking issue: #3350)
1828
1829 #### `false` (default):
1830
1831 ```rust
1832 // Lorem ipsum:
1833 fn dolor() -> usize {}
1834
1835 /* sit amet: */
1836 fn adipiscing() -> usize {}
1837 ```
1838
1839 #### `true`:
1840
1841 ```rust
1842 // Lorem ipsum:
1843 fn dolor() -> usize {}
1844
1845 // sit amet:
1846 fn adipiscing() -> usize {}
1847 ```
1848
1849 ## `normalize_doc_attributes`
1850
1851 Convert `#![doc]` and `#[doc]` attributes to `//!` and `///` doc comments.
1852
1853 - **Default value**: `false`
1854 - **Possible values**: `true`, `false`
1855 - **Stable**: No (tracking issue: #3351)
1856
1857 #### `false` (default):
1858
1859 ```rust
1860 #![doc = "Example documentation"]
1861
1862 #[doc = "Example item documentation"]
1863 pub enum Bar {}
1864
1865 /// Example item documentation
1866 pub enum Foo {}
1867 ```
1868
1869 #### `true`:
1870
1871 ```rust
1872 //! Example documentation
1873
1874 /// Example item documentation
1875 pub enum Foo {}
1876 ```
1877
1878 ## `overflow_delimited_expr`
1879
1880 When structs, slices, arrays, and block/array-like macros are used as the last
1881 argument in an expression list, allow them to overflow (like blocks/closures)
1882 instead of being indented on a new line.
1883
1884 - **Default value**: `false`
1885 - **Possible values**: `true`, `false`
1886 - **Stable**: No (tracking issue: #3370)
1887
1888 #### `false` (default):
1889
1890 ```rust
1891 fn example() {
1892     foo(ctx, |param| {
1893         action();
1894         foo(param)
1895     });
1896
1897     foo(
1898         ctx,
1899         Bar {
1900             x: value,
1901             y: value2,
1902         },
1903     );
1904
1905     foo(
1906         ctx,
1907         &[
1908             MAROON_TOMATOES,
1909             PURPLE_POTATOES,
1910             ORGANE_ORANGES,
1911             GREEN_PEARS,
1912             RED_APPLES,
1913         ],
1914     );
1915
1916     foo(
1917         ctx,
1918         vec![
1919             MAROON_TOMATOES,
1920             PURPLE_POTATOES,
1921             ORGANE_ORANGES,
1922             GREEN_PEARS,
1923             RED_APPLES,
1924         ],
1925     );
1926 }
1927 ```
1928
1929 #### `true`:
1930
1931 ```rust
1932 fn example() {
1933     foo(ctx, |param| {
1934         action();
1935         foo(param)
1936     });
1937
1938     foo(ctx, Bar {
1939         x: value,
1940         y: value2,
1941     });
1942
1943     foo(ctx, &[
1944         MAROON_TOMATOES,
1945         PURPLE_POTATOES,
1946         ORGANE_ORANGES,
1947         GREEN_PEARS,
1948         RED_APPLES,
1949     ]);
1950
1951     foo(ctx, vec![
1952         MAROON_TOMATOES,
1953         PURPLE_POTATOES,
1954         ORGANE_ORANGES,
1955         GREEN_PEARS,
1956         RED_APPLES,
1957     ]);
1958 }
1959 ```
1960
1961 ## `remove_nested_parens`
1962
1963 Remove nested parens.
1964
1965 - **Default value**: `true`,
1966 - **Possible values**: `true`, `false`
1967 - **Stable**: Yes
1968
1969
1970 #### `true` (default):
1971 ```rust
1972 fn main() {
1973     (foo());
1974 }
1975 ```
1976
1977 #### `false`:
1978 ```rust
1979 fn main() {
1980     (foo());
1981
1982     ((((foo()))));
1983 }
1984 ```
1985
1986
1987 ## `reorder_impl_items`
1988
1989 Reorder impl items. `type` and `const` are put first, then macros and methods.
1990
1991 - **Default value**: `false`
1992 - **Possible values**: `true`, `false`
1993 - **Stable**: No (tracking issue: #3363)
1994
1995 #### `false` (default)
1996
1997 ```rust
1998 struct Dummy;
1999
2000 impl Iterator for Dummy {
2001     fn next(&mut self) -> Option<Self::Item> {
2002         None
2003     }
2004
2005     type Item = i32;
2006 }
2007
2008 impl Iterator for Dummy {
2009     type Item = i32;
2010
2011     fn next(&mut self) -> Option<Self::Item> {
2012         None
2013     }
2014 }
2015 ```
2016
2017 #### `true`
2018
2019 ```rust
2020 struct Dummy;
2021
2022 impl Iterator for Dummy {
2023     type Item = i32;
2024
2025     fn next(&mut self) -> Option<Self::Item> {
2026         None
2027     }
2028 }
2029 ```
2030
2031 ## `reorder_imports`
2032
2033 Reorder import and extern crate statements alphabetically in groups (a group is
2034 separated by a newline).
2035
2036 - **Default value**: `true`
2037 - **Possible values**: `true`, `false`
2038 - **Stable**: Yes
2039
2040 #### `true` (default):
2041
2042 ```rust
2043 use dolor;
2044 use ipsum;
2045 use lorem;
2046 use sit;
2047 ```
2048
2049 #### `false`:
2050
2051 ```rust
2052 use lorem;
2053 use ipsum;
2054 use dolor;
2055 use sit;
2056 ```
2057
2058 ## `group_imports`
2059
2060 Controls the strategy for how imports are grouped together.
2061
2062 - **Default value**: `Preserve`
2063 - **Possible values**: `Preserve`, `StdExternalCrate`
2064 - **Stable**: No
2065
2066 #### `Preserve` (default):
2067
2068 Preserve the source file's import groups.
2069
2070 ```rust
2071 use super::update::convert_publish_payload;
2072 use chrono::Utc;
2073
2074 use alloc::alloc::Layout;
2075 use juniper::{FieldError, FieldResult};
2076 use uuid::Uuid;
2077
2078 use std::sync::Arc;
2079
2080 use broker::database::PooledConnection;
2081
2082 use super::schema::{Context, Payload};
2083 use crate::models::Event;
2084 use core::f32;
2085 ```
2086
2087 #### `StdExternalCrate`:
2088
2089 Discard existing import groups, and create three groups for:
2090 1. `std`, `core` and `alloc`,
2091 2. external crates,
2092 3. `self`, `super` and `crate` imports.
2093
2094 ```rust
2095 use alloc::alloc::Layout;
2096 use core::f32;
2097 use std::sync::Arc;
2098
2099 use broker::database::PooledConnection;
2100 use chrono::Utc;
2101 use juniper::{FieldError, FieldResult};
2102 use uuid::Uuid;
2103
2104 use super::schema::{Context, Payload};
2105 use super::update::convert_publish_payload;
2106 use crate::models::Event;
2107 ```
2108
2109 ## `reorder_modules`
2110
2111 Reorder `mod` declarations alphabetically in group.
2112
2113 - **Default value**: `true`
2114 - **Possible values**: `true`, `false`
2115 - **Stable**: Yes
2116
2117 #### `true` (default)
2118
2119 ```rust
2120 mod a;
2121 mod b;
2122
2123 mod dolor;
2124 mod ipsum;
2125 mod lorem;
2126 mod sit;
2127 ```
2128
2129 #### `false`
2130
2131 ```rust
2132 mod b;
2133 mod a;
2134
2135 mod lorem;
2136 mod ipsum;
2137 mod dolor;
2138 mod sit;
2139 ```
2140
2141 **Note** `mod` with `#[macro_export]` will not be reordered since that could change the semantics
2142 of the original source code.
2143
2144 ## `report_fixme`
2145
2146 Report `FIXME` items in comments.
2147
2148 - **Default value**: `"Never"`
2149 - **Possible values**: `"Always"`, `"Unnumbered"`, `"Never"`
2150 - **Stable**: No (tracking issue: #3394)
2151
2152 Warns about any comments containing `FIXME` in them when set to `"Always"`. If
2153 it contains a `#X` (with `X` being a number) in parentheses following the
2154 `FIXME`, `"Unnumbered"` will ignore it.
2155
2156 See also [`report_todo`](#report_todo).
2157
2158
2159 ## `report_todo`
2160
2161 Report `TODO` items in comments.
2162
2163 - **Default value**: `"Never"`
2164 - **Possible values**: `"Always"`, `"Unnumbered"`, `"Never"`
2165 - **Stable**: No (tracking issue: #3393)
2166
2167 Warns about any comments containing `TODO` in them when set to `"Always"`. If
2168 it contains a `#X` (with `X` being a number) in parentheses following the
2169 `TODO`, `"Unnumbered"` will ignore it.
2170
2171 See also [`report_fixme`](#report_fixme).
2172
2173 ## `required_version`
2174
2175 Require a specific version of rustfmt. If you want to make sure that the
2176 specific version of rustfmt is used in your CI, use this option.
2177
2178 - **Default value**: `CARGO_PKG_VERSION`
2179 - **Possible values**: any published version (e.g. `"0.3.8"`)
2180 - **Stable**: No (tracking issue: #3386)
2181
2182 ## `skip_children`
2183
2184 Don't reformat out of line modules
2185
2186 - **Default value**: `false`
2187 - **Possible values**: `true`, `false`
2188 - **Stable**: No (tracking issue: #3389)
2189
2190 ## `single_line_if_else_max_width`
2191
2192 Maximum line length for single line if-else expressions. A value of `0` (zero) results in if-else expressions always being broken into multiple lines. Note this occurs when `use_small_heuristics` is set to `Off`.
2193
2194 - **Default value**: `50`
2195 - **Possible values**: any positive integer that is less than or equal to the value specified for [`max_width`](#max_width)
2196 - **Stable**: Yes
2197
2198 By default this option is set as a percentage of [`max_width`](#max_width) provided by [`use_small_heuristics`](#use_small_heuristics), but a value set directly for `single_line_if_else_max_width` will take precedence.
2199
2200 See also [`max_width`](#max_width) and [`use_small_heuristics`](#use_small_heuristics)
2201
2202 ## `space_after_colon`
2203
2204 Leave a space after the colon.
2205
2206 - **Default value**: `true`
2207 - **Possible values**: `true`, `false`
2208 - **Stable**: No (tracking issue: #3366)
2209
2210 #### `true` (default):
2211
2212 ```rust
2213 fn lorem<T: Eq>(t: T) {
2214     let lorem: Dolor = Lorem {
2215         ipsum: dolor,
2216         sit: amet,
2217     };
2218 }
2219 ```
2220
2221 #### `false`:
2222
2223 ```rust
2224 fn lorem<T:Eq>(t:T) {
2225     let lorem:Dolor = Lorem {
2226         ipsum:dolor,
2227         sit:amet,
2228     };
2229 }
2230 ```
2231
2232 See also: [`space_before_colon`](#space_before_colon).
2233
2234 ## `space_before_colon`
2235
2236 Leave a space before the colon.
2237
2238 - **Default value**: `false`
2239 - **Possible values**: `true`, `false`
2240 - **Stable**: No (tracking issue: #3365)
2241
2242 #### `false` (default):
2243
2244 ```rust
2245 fn lorem<T: Eq>(t: T) {
2246     let lorem: Dolor = Lorem {
2247         ipsum: dolor,
2248         sit: amet,
2249     };
2250 }
2251 ```
2252
2253 #### `true`:
2254
2255 ```rust
2256 fn lorem<T : Eq>(t : T) {
2257     let lorem : Dolor = Lorem {
2258         ipsum : dolor,
2259         sit : amet,
2260     };
2261 }
2262 ```
2263
2264 See also: [`space_after_colon`](#space_after_colon).
2265
2266 ## `spaces_around_ranges`
2267
2268 Put spaces around the .., ..=, and ... range operators
2269
2270 - **Default value**: `false`
2271 - **Possible values**: `true`, `false`
2272 - **Stable**: No (tracking issue: #3367)
2273
2274 #### `false` (default):
2275
2276 ```rust
2277 fn main() {
2278     let lorem = 0..10;
2279     let ipsum = 0..=10;
2280
2281     match lorem {
2282         1..5 => foo(),
2283         _ => bar,
2284     }
2285
2286     match lorem {
2287         1..=5 => foo(),
2288         _ => bar,
2289     }
2290
2291     match lorem {
2292         1...5 => foo(),
2293         _ => bar,
2294     }
2295 }
2296 ```
2297
2298 #### `true`:
2299
2300 ```rust
2301 fn main() {
2302     let lorem = 0 .. 10;
2303     let ipsum = 0 ..= 10;
2304
2305     match lorem {
2306         1 .. 5 => foo(),
2307         _ => bar,
2308     }
2309
2310     match lorem {
2311         1 ..= 5 => foo(),
2312         _ => bar,
2313     }
2314
2315     match lorem {
2316         1 ... 5 => foo(),
2317         _ => bar,
2318     }
2319 }
2320 ```
2321
2322 ## `struct_field_align_threshold`
2323
2324 The maximum diff of width between struct fields to be aligned with each other.
2325
2326 - **Default value** : 0
2327 - **Possible values**: any non-negative integer
2328 - **Stable**: No (tracking issue: #3371)
2329
2330 #### `0` (default):
2331
2332 ```rust
2333 struct Foo {
2334     x: u32,
2335     yy: u32,
2336     zzz: u32,
2337 }
2338 ```
2339
2340 #### `20`:
2341
2342 ```rust
2343 struct Foo {
2344     x:   u32,
2345     yy:  u32,
2346     zzz: u32,
2347 }
2348 ```
2349
2350 ## `struct_lit_single_line`
2351
2352 Put small struct literals on a single line
2353
2354 - **Default value**: `true`
2355 - **Possible values**: `true`, `false`
2356 - **Stable**: No (tracking issue: #3357)
2357
2358 #### `true` (default):
2359
2360 ```rust
2361 fn main() {
2362     let lorem = Lorem { foo: bar, baz: ofo };
2363 }
2364 ```
2365
2366 #### `false`:
2367
2368 ```rust
2369 fn main() {
2370     let lorem = Lorem {
2371         foo: bar,
2372         baz: ofo,
2373     };
2374 }
2375 ```
2376
2377 See also: [`indent_style`](#indent_style).
2378
2379 ## `struct_lit_width`
2380
2381 Maximum width in the body of a struct literal before falling back to vertical formatting. A value of `0` (zero) results in struct literals always being broken into multiple lines. Note this occurs when `use_small_heuristics` is set to `Off`.
2382
2383 - **Default value**: `18`
2384 - **Possible values**: any positive integer that is less than or equal to the value specified for [`max_width`](#max_width)
2385 - **Stable**: Yes
2386
2387 By default this option is set as a percentage of [`max_width`](#max_width) provided by [`use_small_heuristics`](#use_small_heuristics), but a value set directly for `struct_lit_width` will take precedence.
2388
2389 See also [`max_width`](#max_width), [`use_small_heuristics`](#use_small_heuristics), and [`struct_lit_single_line`](#struct_lit_single_line)
2390
2391 ## `struct_variant_width`
2392
2393 Maximum width in the body of a struct variant before falling back to vertical formatting. A value of `0` (zero) results in struct literals always being broken into multiple lines. Note this occurs when `use_small_heuristics` is set to `Off`.
2394
2395 - **Default value**: `35`
2396 - **Possible values**: any positive integer that is less than or equal to the value specified for [`max_width`](#max_width)
2397 - **Stable**: Yes
2398
2399 By default this option is set as a percentage of [`max_width`](#max_width) provided by [`use_small_heuristics`](#use_small_heuristics), but a value set directly for `struct_variant_width` will take precedence.
2400
2401 See also [`max_width`](#max_width) and [`use_small_heuristics`](#use_small_heuristics)
2402
2403 ## `tab_spaces`
2404
2405 Number of spaces per tab
2406
2407 - **Default value**: `4`
2408 - **Possible values**: any positive integer
2409 - **Stable**: Yes
2410
2411 #### `4` (default):
2412
2413 ```rust
2414 fn lorem() {
2415     let ipsum = dolor();
2416     let sit = vec![
2417         "amet consectetur adipiscing elit amet",
2418         "consectetur adipiscing elit amet consectetur.",
2419     ];
2420 }
2421 ```
2422
2423 #### `2`:
2424
2425 ```rust
2426 fn lorem() {
2427   let ipsum = dolor();
2428   let sit = vec![
2429     "amet consectetur adipiscing elit amet",
2430     "consectetur adipiscing elit amet consectetur.",
2431   ];
2432 }
2433 ```
2434
2435 See also: [`hard_tabs`](#hard_tabs).
2436
2437
2438 ## `trailing_comma`
2439
2440 How to handle trailing commas for lists
2441
2442 - **Default value**: `"Vertical"`
2443 - **Possible values**: `"Always"`, `"Never"`, `"Vertical"`
2444 - **Stable**: No (tracking issue: #3379)
2445
2446 #### `"Vertical"` (default):
2447
2448 ```rust
2449 fn main() {
2450     let Lorem { ipsum, dolor, sit } = amet;
2451     let Lorem {
2452         ipsum,
2453         dolor,
2454         sit,
2455         amet,
2456         consectetur,
2457         adipiscing,
2458     } = elit;
2459 }
2460 ```
2461
2462 #### `"Always"`:
2463
2464 ```rust
2465 fn main() {
2466     let Lorem { ipsum, dolor, sit, } = amet;
2467     let Lorem {
2468         ipsum,
2469         dolor,
2470         sit,
2471         amet,
2472         consectetur,
2473         adipiscing,
2474     } = elit;
2475 }
2476 ```
2477
2478 #### `"Never"`:
2479
2480 ```rust
2481 fn main() {
2482     let Lorem { ipsum, dolor, sit } = amet;
2483     let Lorem {
2484         ipsum,
2485         dolor,
2486         sit,
2487         amet,
2488         consectetur,
2489         adipiscing
2490     } = elit;
2491 }
2492 ```
2493
2494 See also: [`match_block_trailing_comma`](#match_block_trailing_comma).
2495
2496 ## `trailing_semicolon`
2497
2498 Add trailing semicolon after break, continue and return
2499
2500 - **Default value**: `true`
2501 - **Possible values**: `true`, `false`
2502 - **Stable**: No (tracking issue: #3378)
2503
2504 #### `true` (default):
2505 ```rust
2506 fn foo() -> usize {
2507     return 0;
2508 }
2509 ```
2510
2511 #### `false`:
2512 ```rust
2513 fn foo() -> usize {
2514     return 0
2515 }
2516 ```
2517
2518 ## `type_punctuation_density`
2519
2520 Determines if `+` or `=` are wrapped in spaces in the punctuation of types
2521
2522 - **Default value**: `"Wide"`
2523 - **Possible values**: `"Compressed"`, `"Wide"`
2524 - **Stable**: No (tracking issue: #3364)
2525
2526 #### `"Wide"` (default):
2527
2528 ```rust
2529 fn lorem<Ipsum: Dolor + Sit = Amet>() {
2530     // body
2531 }
2532 ```
2533
2534 #### `"Compressed"`:
2535
2536 ```rust
2537 fn lorem<Ipsum: Dolor+Sit=Amet>() {
2538     // body
2539 }
2540 ```
2541
2542 ## `unstable_features`
2543
2544 Enable unstable features on the unstable channel.
2545
2546 - **Default value**: `false`
2547 - **Possible values**: `true`, `false`
2548 - **Stable**: No (tracking issue: #3387)
2549
2550 ## `use_field_init_shorthand`
2551
2552 Use field initialize shorthand if possible.
2553
2554 - **Default value**: `false`
2555 - **Possible values**: `true`, `false`
2556 - **Stable**: Yes
2557
2558 #### `false` (default):
2559
2560 ```rust
2561 struct Foo {
2562     x: u32,
2563     y: u32,
2564     z: u32,
2565 }
2566
2567 fn main() {
2568     let x = 1;
2569     let y = 2;
2570     let z = 3;
2571     let a = Foo { x, y, z };
2572     let b = Foo { x: x, y: y, z: z };
2573 }
2574 ```
2575
2576 #### `true`:
2577
2578 ```rust
2579 struct Foo {
2580     x: u32,
2581     y: u32,
2582     z: u32,
2583 }
2584
2585 fn main() {
2586     let x = 1;
2587     let y = 2;
2588     let z = 3;
2589     let a = Foo { x, y, z };
2590 }
2591 ```
2592
2593 ## `use_small_heuristics`
2594
2595 This option can be used to simplify the management and bulk updates of the granular width configuration settings ([`fn_call_width`](#fn_call_width), [`attr_fn_like_width`](#attr_fn_like_width), [`struct_lit_width`](#struct_lit_width), [`struct_variant_width`](#struct_variant_width), [`array_width`](#array_width), [`chain_width`](#chain_width), [`single_line_if_else_max_width`](#single_line_if_else_max_width)), that respectively control when formatted constructs are multi-lined/vertical based on width.
2596
2597 Note that explicitly provided values for the width configuration settings take precedence and override the calculated values determined by `use_small_heuristics`.
2598
2599 - **Default value**: `"Default"`
2600 - **Possible values**: `"Default"`, `"Off"`, `"Max"`
2601 - **Stable**: Yes
2602
2603 #### `Default` (default):
2604 When `use_small_heuristics` is set to `Default`, the values for the granular width settings are calculated as a ratio of the value for `max_width`.
2605
2606 The ratios are:
2607 * [`fn_call_width`](#fn_call_width) - `60%`
2608 * [`attr_fn_like_width`](#attr_fn_like_width) - `70%`
2609 * [`struct_lit_width`](#struct_lit_width) - `18%`
2610 * [`struct_variant_width`](#struct_variant_width) - `35%`
2611 * [`array_width`](#array_width) - `60%`
2612 * [`chain_width`](#chain_width) - `60%`
2613 * [`single_line_if_else_max_width`](#single_line_if_else_max_width) - `50%`
2614
2615 For example when `max_width` is set to `100`, the width settings are:
2616 * `fn_call_width=60`
2617 * `attr_fn_like_width=70`
2618 * `struct_lit_width=18`
2619 * `struct_variant_width=35`
2620 * `array_width=60`
2621 * `chain_width=60`
2622 * `single_line_if_else_max_width=50`
2623
2624 and when `max_width` is set to `200`:
2625 * `fn_call_width=120`
2626 * `attr_fn_like_width=140`
2627 * `struct_lit_width=36`
2628 * `struct_variant_width=70`
2629 * `array_width=120`
2630 * `chain_width=120`
2631 * `single_line_if_else_max_width=100`
2632
2633 ```rust
2634 enum Lorem {
2635     Ipsum,
2636     Dolor(bool),
2637     Sit { amet: Consectetur, adipiscing: Elit },
2638 }
2639
2640 fn main() {
2641     lorem(
2642         "lorem",
2643         "ipsum",
2644         "dolor",
2645         "sit",
2646         "amet",
2647         "consectetur",
2648         "adipiscing",
2649     );
2650
2651     let lorem = Lorem {
2652         ipsum: dolor,
2653         sit: amet,
2654     };
2655     let lorem = Lorem { ipsum: dolor };
2656
2657     let lorem = if ipsum { dolor } else { sit };
2658 }
2659 ```
2660
2661 #### `Off`:
2662 When `use_small_heuristics` is set to `Off`, the granular width settings are functionally disabled and ignored. See the documentation for the respective width config options for specifics.
2663
2664 ```rust
2665 enum Lorem {
2666     Ipsum,
2667     Dolor(bool),
2668     Sit {
2669         amet: Consectetur,
2670         adipiscing: Elit,
2671     },
2672 }
2673
2674 fn main() {
2675     lorem("lorem", "ipsum", "dolor", "sit", "amet", "consectetur", "adipiscing");
2676
2677     let lorem = Lorem {
2678         ipsum: dolor,
2679         sit: amet,
2680     };
2681
2682     let lorem = if ipsum {
2683         dolor
2684     } else {
2685         sit
2686     };
2687 }
2688 ```
2689
2690 #### `Max`:
2691 When `use_small_heuristics` is set to `Max`, then each granular width setting is set to the same value as `max_width`.
2692
2693 So if `max_width` is set to `200`, then all the width settings are also set to `200`.
2694 * `fn_call_width=200`
2695 * `attr_fn_like_width=200`
2696 * `struct_lit_width=200`
2697 * `struct_variant_width=200`
2698 * `array_width=200`
2699 * `chain_width=200`
2700 * `single_line_if_else_max_width=200`
2701
2702 ```rust
2703 enum Lorem {
2704     Ipsum,
2705     Dolor(bool),
2706     Sit { amet: Consectetur, adipiscing: Elit },
2707 }
2708
2709 fn main() {
2710     lorem("lorem", "ipsum", "dolor", "sit", "amet", "consectetur", "adipiscing");
2711
2712     let lorem = Lorem { ipsum: dolor, sit: amet };
2713
2714     let lorem = if ipsum { dolor } else { sit };
2715 }
2716 ```
2717
2718
2719 See also:
2720 * [`max_width`](#max_width)
2721 * [`fn_call_width`](#fn_call_width)
2722 * [`attr_fn_like_width`](#attr_fn_like_width)
2723 * [`struct_lit_width`](#struct_lit_width)
2724 * [`struct_variant_width`](#struct_variant_width)
2725 * [`array_width`](#array_width)
2726 * [`chain_width`](#chain_width)
2727 * [`single_line_if_else_max_width`](#single_line_if_else_max_width)
2728
2729 ## `use_try_shorthand`
2730
2731 Replace uses of the try! macro by the ? shorthand
2732
2733 - **Default value**: `false`
2734 - **Possible values**: `true`, `false`
2735 - **Stable**: Yes
2736
2737 #### `false` (default):
2738
2739 ```rust
2740 fn main() {
2741     let lorem = ipsum.map(|dolor| dolor.sit())?;
2742
2743     let lorem = try!(ipsum.map(|dolor| dolor.sit()));
2744 }
2745 ```
2746
2747 #### `true`:
2748
2749 ```rust
2750 fn main() {
2751     let lorem = ipsum.map(|dolor| dolor.sit())?;
2752 }
2753 ```
2754
2755 ## `version`
2756
2757 Which version of the formatting rules to use. `Version::One` is backwards-compatible
2758 with Rustfmt 1.0. Other versions are only backwards compatible within a major
2759 version number.
2760
2761 - **Default value**: `One`
2762 - **Possible values**: `One`, `Two`
2763 - **Stable**: No (tracking issue: #3383)
2764
2765 ### Example
2766
2767 ```toml
2768 version = "Two"
2769 ```
2770
2771 ## `where_single_line`
2772
2773 Forces the `where` clause to be laid out on a single line.
2774
2775 - **Default value**: `false`
2776 - **Possible values**: `true`, `false`
2777 - **Stable**: No (tracking issue: #3359)
2778
2779 #### `false` (default):
2780
2781 ```rust
2782 impl<T> Lorem for T
2783 where
2784     Option<T>: Ipsum,
2785 {
2786     // body
2787 }
2788 ```
2789
2790 #### `true`:
2791
2792 ```rust
2793 impl<T> Lorem for T
2794 where Option<T>: Ipsum
2795 {
2796     // body
2797 }
2798 ```
2799
2800 See also [`brace_style`](#brace_style), [`control_brace_style`](#control_brace_style).
2801
2802
2803 ## `wrap_comments`
2804
2805 Break comments to fit on the line
2806
2807 - **Default value**: `false`
2808 - **Possible values**: `true`, `false`
2809 - **Stable**: No (tracking issue: #3347)
2810
2811 #### `false` (default):
2812
2813 ```rust
2814 // Lorem ipsum dolor sit amet, consectetur adipiscing elit,
2815 // sed do eiusmod tempor incididunt ut labore et dolore
2816 // magna aliqua. Ut enim ad minim veniam, quis nostrud
2817 // exercitation ullamco laboris nisi ut aliquip ex ea
2818 // commodo consequat.
2819
2820 // 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.
2821 ```
2822
2823 #### `true`:
2824
2825 ```rust
2826 // Lorem ipsum dolor sit amet, consectetur adipiscing elit,
2827 // sed do eiusmod tempor incididunt ut labore et dolore
2828 // magna aliqua. Ut enim ad minim veniam, quis nostrud
2829 // exercitation ullamco laboris nisi ut aliquip ex ea
2830 // commodo consequat.
2831 ```
2832
2833 # Internal Options
2834
2835 ## `emit_mode`
2836
2837 Internal option
2838
2839 ## `make_backup`
2840
2841 Internal option, use `--backup`
2842
2843 ## `print_misformatted_file_names`
2844
2845 Internal option, use `-l` or `--files-with-diff`