]> git.lizzy.rs Git - rust.git/blob - Configurations.md
Document control_style in Configurations.md
[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.
4
5 A possible content of `rustfmt.toml` or `.rustfmt.toml` might look like this:
6
7 ```toml
8 array_layout = "Block"
9 array_width = 80
10 reorder_imported_names = true
11 ```
12
13 # Configuration Options
14
15 Below you find a detailed visual guide on all the supported configuration options of rustfmt:
16
17 ## `array_layout`
18
19 Indent on arrays
20
21 - **Default value**: `"Block"`
22 - **Possible values**: `"Block"`, `"Visual"`
23
24 #### `"Block"`:
25
26 ```rust
27 let lorem = vec![
28     "ipsum",
29     "dolor",
30     "sit",
31     "amet",
32     "consectetur",
33     "adipiscing",
34     "elit",
35 ];
36 ```
37
38 #### `"Visual"`:
39
40 ```rust
41 let lorem = vec!["ipsum",
42                  "dolor",
43                  "sit",
44                  "amet",
45                  "consectetur",
46                  "adipiscing",
47                  "elit"];
48 ```
49
50 ## `array_width`
51
52 Maximum width of an array literal before falling back to vertical formatting
53
54 - **Default value**: `60`
55 - **Possible values**: any positive integer
56
57 **Note:** A value of `0` results in [`array_layout`](#array_layout) being applied regardless of a line's width.
58
59 #### Lines shorter than `array_width`:
60 ```rust
61 let lorem =
62     vec!["ipsum", "dolor", "sit", "amet", "consectetur", "adipiscing", "elit"];
63 ```
64
65 #### Lines longer than `array_width`:
66 See [`array_layout`](#array_layout).
67
68 ## `chain_indent`
69
70 Indentation of chain
71
72 - **Default value**: `"Block"`
73 - **Possible values**: `"Block"`, `"Visual"`
74
75 #### `"Block"`:
76
77 ```rust
78 let lorem = ipsum
79     .dolor()
80     .sit()
81     .amet()
82     .consectetur()
83     .adipiscing()
84     .elit();
85 ```
86
87 #### `"Visual"`:
88
89 ```rust
90 let lorem = ipsum.dolor()
91                  .sit()
92                  .amet()
93                  .consectetur()
94                  .adipiscing()
95                  .elit();
96 ```
97
98 See also [`chain_one_line_max`](#chain_one_line_max).
99
100 ## `chain_one_line_max`
101
102 Maximum length of a chain to fit on a single line
103
104 - **Default value**: `60`
105 - **Possible values**: any positive integer
106
107 #### Lines shorter than `chain_one_line_max`:
108 ```rust
109 let lorem = ipsum.dolor().sit().amet().consectetur().adipiscing().elit();
110 ```
111
112 #### Lines longer than `chain_one_line_max`:
113 See [`chain_indent`](#chain_indent).
114
115 ## `chain_split_single_child`
116
117 Split a chain with a single child if its length exceeds [`chain_one_line_max`](#chain_one_line_max).
118
119 - **Default value**: `false`
120 - **Possible values**: `false`, `true`
121
122 #### `false`
123
124 ```rust
125 let files = fs::read_dir("tests/coverage/source").expect("Couldn't read source dir");
126 ```
127
128 #### `true`
129
130 ```rust
131 let files = fs::read_dir("tests/coverage/source")
132     .expect("Couldn't read source dir");
133 ```
134
135 See also [`chain_one_line_max`](#chain_one_line_max).
136
137 ## `closure_block_indent_threshold`
138
139 How many lines a closure must have before it is block indented. -1 means never use block indent.
140
141 - **Default value**: `7`
142 - **Possible values**: `-1`, or any positive integer
143
144 #### Closures shorter than `closure_block_indent_threshold`:
145 ```rust
146 lorem_ipsum(|| {
147                 println!("lorem");
148                 println!("ipsum");
149                 println!("dolor");
150                 println!("sit");
151                 println!("amet");
152             });
153 ```
154
155 #### Closures longer than `closure_block_indent_threshold`:
156 ```rust
157 lorem_ipsum(|| {
158     println!("lorem");
159     println!("ipsum");
160     println!("dolor");
161     println!("sit");
162     println!("amet");
163     println!("consectetur");
164     println!("adipiscing");
165     println!("elit");
166 });
167 ```
168
169 ## `combine_control_expr`
170
171 Combine control expressions with function calls.
172
173 - **Default value**: `true`
174 - **Possible values**: `true`, `false`
175
176 #### `true`
177
178 ```rust
179 fn example() {
180     // If
181     foo!(if x {
182         foo();
183     } else {
184         bar();
185     });
186
187     // IfLet
188     foo!(if let Some(..) = x {
189         foo();
190     } else {
191         bar();
192     });
193
194     // While
195     foo!(while x {
196         foo();
197         bar();
198     });
199
200     // WhileLet
201     foo!(while let Some(..) = x {
202         foo();
203         bar();
204     });
205
206     // ForLoop
207     foo!(for x in y {
208         foo();
209         bar();
210     });
211
212     // Loop
213     foo!(loop {
214         foo();
215         bar();
216     });
217 }
218 ```
219
220 #### `false`
221
222 ```rust
223 ```
224
225 ## `comment_width`
226
227 Maximum length of comments. No effect unless`wrap_comments = true`.
228
229 - **Default value**: `80`
230 - **Possible values**: any positive integer
231
232 **Note:** A value of `0` results in [`wrap_comments`](#wrap_comments) being applied regardless of a line's width.
233
234 #### Comments shorter than `comment_width`:
235 ```rust
236 // Lorem ipsum dolor sit amet, consectetur adipiscing elit.
237 ```
238
239 #### Comments longer than `comment_width`:
240 ```rust
241 // Lorem ipsum dolor sit amet,
242 // consectetur adipiscing elit.
243 ```
244
245 See also [`wrap_comments`](#wrap_comments).
246
247 ## `condense_wildcard_suffixes`
248
249 Replace strings of _ wildcards by a single .. in tuple patterns
250
251 - **Default value**: `false`
252 - **Possible values**: `true`, `false`
253
254 #### `false`:
255
256 ```rust
257 let (lorem, ipsum, _, _) = (1, 2, 3, 4);
258 ```
259
260 #### `true`:
261
262 ```rust
263 let (lorem, ipsum, ..) = (1, 2, 3, 4);
264 ```
265
266 ## `control_style`
267
268 Indent style for control flow statements
269
270 - **Default value**: `"Rfc"`
271 - **Possible values**: `"Rfc"`, `"Legacy"`
272
273 #### `"Rfc"`:
274
275 ```rust
276 // Conditional expression containing line-break
277 if lorem(
278     ipsum,
279     dolor,
280 )
281 {
282     // ...
283 }
284 ```
285
286 #### `"Legacy"`:
287
288 ```rust
289 // Conditional expression containing line-break
290 if lorem(
291     ipsum,
292     dolor,
293 ) {
294     // ...
295 }
296 ```
297
298 See also: [`control_brace_style`](#control_brace_style).
299
300 ## `control_brace_style`
301
302 Brace style for control flow constructs
303
304 - **Default value**: `"AlwaysSameLine"`
305 - **Possible values**: `"AlwaysNextLine"`, `"AlwaysSameLine"`, `"ClosingNextLine"`
306
307 #### `"AlwaysNextLine"`:
308
309 ```rust
310 if lorem
311 {
312     println!("ipsum!");
313 }
314 else
315 {
316     println!("dolor!");
317 }
318 ```
319
320 #### `"AlwaysSameLine"`:
321
322 ```rust
323 if lorem {
324     println!("ipsum!");
325 } else {
326     println!("dolor!");
327 }
328 ```
329
330 #### `"ClosingNextLine"`:
331
332 ```rust
333 if lorem {
334     println!("ipsum!");
335 }
336 else {
337     println!("dolor!");
338 }
339 ```
340
341 ## `disable_all_formatting`
342
343 Don't reformat anything
344
345 - **Default value**: `false`
346 - **Possible values**: `true`, `false`
347
348 ## `error_on_line_overflow`
349
350 Error if unable to get all lines within max_width
351
352 - **Default value**: `true`
353 - **Possible values**: `true`, `false`
354
355 See also [`max_width`](#max_width).
356
357 ## `fn_args_density`
358
359 Argument density in functions
360
361 - **Default value**: `"Tall"`
362 - **Possible values**: `"Compressed"`, `"CompressedIfEmpty"`, `"Tall"`, `"Vertical"`
363
364 #### `"Compressed"`:
365
366 ```rust
367 trait Lorem {
368     fn lorem(ipsum: Ipsum, dolor: Dolor, sit: Sit, amet: Amet);
369
370     fn lorem(ipsum: Ipsum, dolor: Dolor, sit: Sit, amet: Amet) {
371         // body
372     }
373
374     fn lorem(ipsum: Ipsum, dolor: Dolor, sit: Sit, amet: Amet, consectetur: Consectetur,
375              adipiscing: Adipiscing, elit: Elit);
376
377     fn lorem(ipsum: Ipsum, dolor: Dolor, sit: Sit, amet: Amet, consectetur: Consectetur,
378              adipiscing: Adipiscing, elit: Elit) {
379         // body
380     }
381 }
382 ```
383
384 #### `"CompressedIfEmpty"`:
385
386 ```rust
387 trait Lorem {
388     fn lorem(ipsum: Ipsum, dolor: Dolor, sit: Sit, amet: Amet);
389
390     fn lorem(ipsum: Ipsum, dolor: Dolor, sit: Sit, amet: Amet) {
391         // body
392     }
393
394     fn lorem(ipsum: Ipsum, dolor: Dolor, sit: Sit, amet: Amet, consectetur: Consectetur,
395              adipiscing: Adipiscing, elit: Elit);
396
397     fn lorem(ipsum: Ipsum,
398              dolor: Dolor,
399              sit: Sit,
400              amet: Amet,
401              consectetur: onsectetur,
402              adipiscing: Adipiscing,
403              elit: Elit) {
404         // body
405     }
406 }
407 ```
408
409 #### `"Tall"`:
410
411 ```rust
412 trait Lorem {
413     fn lorem(ipsum: Ipsum, dolor: Dolor, sit: Sit, amet: Amet);
414
415     fn lorem(ipsum: Ipsum, dolor: Dolor, sit: Sit, amet: Amet) {
416         // body
417     }
418
419     fn lorem(ipsum: Ipsum,
420              dolor: Dolor,
421              sit: Sit,
422              amet: Amet,
423              consectetur: onsectetur,
424              adipiscing: Adipiscing,
425              elit: Elit);
426
427     fn lorem(ipsum: Ipsum,
428              dolor: Dolor,
429              sit: Sit,
430              amet: Amet,
431              consectetur: onsectetur,
432              adipiscing: Adipiscing,
433              elit: Elit) {
434         // body
435     }
436 }
437 ```
438
439 #### `"Vertical"`:
440
441 ```rust
442 trait Lorem {
443     fn lorem(ipsum: Ipsum,
444              dolor: Dolor,
445              sit: Sit,
446              amet: Amet);
447
448     fn lorem(ipsum: Ipsum,
449              dolor: Dolor,
450              sit: Sit,
451              amet: Amet) {
452         // body
453     }
454
455     fn lorem(ipsum: Ipsum,
456              dolor: Dolor,
457              sit: Sit,
458              amet: Amet,
459              consectetur: onsectetur,
460              adipiscing: Adipiscing,
461              elit: Elit);
462
463     fn lorem(ipsum: Ipsum,
464              dolor: Dolor,
465              sit: Sit,
466              amet: Amet,
467              consectetur: onsectetur,
468              adipiscing: Adipiscing,
469              elit: Elit) {
470         // body
471     }
472 }
473 ```
474
475 ## `fn_args_layout`
476
477 Layout of function arguments and tuple structs
478
479 - **Default value**: `"Block"`
480 - **Possible values**: `"Block"`, `"Visual"`
481
482 #### `"Block"`:
483
484 ```rust
485 fn lorem() {}
486
487 fn lorem(ipsum: usize) {}
488
489 fn lorem(
490     ipsum: usize,
491     dolor: usize,
492     sit: usize,
493     amet: usize,
494     consectetur: usize,
495     adipiscing: usize,
496     elit: usize,
497 ) {
498     // body
499 }
500 ```
501
502 #### `"Visual"`:
503
504 ```rust
505 fn lorem() {}
506
507 fn lorem(ipsum: usize) {}
508
509 fn lorem(ipsum: usize,
510          dolor: usize,
511          sit: usize,
512          amet: usize,
513          consectetur: usize,
514          adipiscing: usize,
515          elit: usize) {
516     // body
517 }
518 ```
519
520 ## `fn_args_paren_newline`
521
522 If function argument parenthesis goes on a newline
523
524 - **Default value**: `false`
525 - **Possible values**: `true`, `false`
526
527 #### `false`:
528
529 ```rust
530 fn lorem(
531     ipsum: Ipsum,
532     dolor: Dolor,
533     sit: Sit,
534     amet: Amet)
535     -> DolorSitAmetConsecteturAdipiscingElitLoremIpsumDolorSitAmetConsecteturAdipiscingElit {
536     // body
537 }
538 ```
539
540 #### `true`:
541
542 ```rust
543 fn lorem
544     (ipsum: Ipsum,
545      dolor: Dolor,
546      sit: Sit,
547      amet: Amet)
548      -> DolorSitAmetConsecteturAdipiscingElitLoremIpsumDolorSitAmetConsecteturAdipiscingElit {
549     // body
550 }
551 ```
552
553 ## `fn_brace_style`
554
555 Brace style for functions
556
557 - **Default value**: `"SameLineWhere"`
558 - **Possible values**: `"AlwaysNextLine"`, `"PreferSameLine"`, `"SameLineWhere"`
559
560 #### `"AlwaysNextLine"`:
561
562 ```rust
563 fn lorem()
564 {
565     // body
566 }
567
568 fn lorem(ipsum: usize)
569 {
570     // body
571 }
572
573 fn lorem<T>(ipsum: T)
574     where T: Add + Sub + Mul + Div
575 {
576     // body
577 }
578 ```
579
580 #### `"PreferSameLine"`:
581
582 ```rust
583 fn lorem() {
584     // body
585 }
586
587 fn lorem(ipsum: usize) {
588     // body
589 }
590
591 fn lorem<T>(ipsum: T)
592     where T: Add + Sub + Mul + Div {
593     // body
594 }
595 ```
596
597 #### `"SameLineWhere"`:
598
599 ```rust
600 fn lorem() {
601     // body
602 }
603
604 fn lorem(ipsum: usize) {
605     // body
606 }
607
608 fn lorem<T>(ipsum: T)
609     where T: Add + Sub + Mul + Div
610 {
611     // body
612 }
613 ```
614
615 ## `fn_call_style`
616
617 Indentation for function calls, etc.
618
619 - **Default value**: `"Block"`
620 - **Possible values**: `"Block"`, `"Visual"`
621
622 #### `"Block"`:
623
624 ```rust
625 lorem(
626     "lorem",
627     "ipsum",
628     "dolor",
629     "sit",
630     "amet",
631     "consectetur",
632     "adipiscing",
633     "elit",
634 );
635 ```
636
637 #### `"Visual"`:
638
639 ```rust
640 lorem("lorem",
641       "ipsum",
642       "dolor",
643       "sit",
644       "amet",
645       "consectetur",
646       "adipiscing",
647       "elit");
648 ```
649
650 ## `fn_call_width`
651
652 Maximum width of the args of a function call before falling back to vertical formatting
653
654 - **Default value**: `60`
655 - **Possible values**: any positive integer
656
657 **Note:** A value of `0` results in vertical formatting being applied regardless of a line's width.
658
659 #### Function call shorter than `fn_call_width`:
660 ```rust
661 lorem("lorem", "ipsum", "dolor", "sit", "amet", "consectetur", "adipiscing", "elit");
662 ```
663
664 #### Function call longer than `fn_call_width`:
665
666 See [`fn_call_style`](#fn_call_style).
667
668 ## `fn_empty_single_line`
669
670 Put empty-body functions on a single line
671
672 - **Default value**: `true`
673 - **Possible values**: `true`, `false`
674
675 #### `false`:
676
677 ```rust
678 fn lorem() {
679 }
680 ```
681
682 #### `true`:
683
684 ```rust
685 fn lorem() {}
686 ```
687
688 See also [`control_brace_style`](#control_brace_style).
689
690 ## `fn_return_indent`
691
692 Location of return type in function declaration
693
694 - **Default value**: `"WithArgs"`
695 - **Possible values**: `"WithArgs"`, `"WithWhereClause"`
696
697 #### `"WithArgs"`:
698
699 ```rust
700 fn lorem(ipsum: Ipsum,
701          dolor: Dolor,
702          sit: Sit,
703          amet: Amet,
704          consectetur: Consectetur,
705          adipiscing: Adipiscing)
706          -> Elit
707     where Ipsum: Eq
708 {
709     // body
710 }
711
712 ```
713
714 #### `"WithWhereClause"`:
715
716 ```rust
717 fn lorem(ipsum: Ipsum,
718          dolor: Dolor,
719          sit: Sit,
720          amet: Amet,
721          consectetur: Consectetur,
722          adipiscing: Adipiscing)
723     -> Elit
724     where Ipsum: Eq
725 {
726     // body
727 }
728
729 ```
730
731 ## `fn_single_line`
732
733 Put single-expression functions on a single line
734
735 - **Default value**: `false`
736 - **Possible values**: `true`, `false`
737
738 #### `false`:
739
740 ```rust
741 fn lorem() -> usize {
742     42
743 }
744
745 fn lorem() -> usize {
746     let ipsum = 42;
747     ipsum
748 }
749 ```
750
751 #### `true`:
752
753 ```rust
754 fn lorem() -> usize { 42 }
755
756 fn lorem() -> usize {
757     let ipsum = 42;
758     ipsum
759 }
760 ```
761
762 See also [`control_brace_style`](#control_brace_style).
763
764 ## `force_explicit_abi`
765
766 Always print the abi for extern items
767
768 - **Default value**: `true`
769 - **Possible values**: `true`, `false`
770
771 **Note:** Non-"C" ABIs are always printed. If `false` then "C" is removed.
772
773 #### `false`:
774
775 ```rust
776 extern {
777     pub static lorem: c_int;
778 }
779 ```
780
781 #### `true`:
782
783 ```rust
784 extern "C" {
785     pub static lorem: c_int;
786 }
787 ```
788
789 ## `force_format_strings`
790
791 Always format string literals
792
793 - **Default value**: `false`
794 - **Possible values**: `true`, `false`
795
796 See [`format_strings`](#format_strings).
797
798 See also [`max_width`](#max_width).
799
800 ## `format_strings`
801
802 Format string literals where necessary
803
804 - **Default value**: `false`
805 - **Possible values**: `true`, `false`
806
807 #### `false`:
808
809 ```rust
810 let lorem = "ipsum dolor sit amet consectetur adipiscing elit lorem ipsum dolor sit";
811 ```
812
813 #### `true`:
814
815 ```rust
816 let lorem =
817     "ipsum dolor sit amet consectetur \
818      adipiscing elit lorem ipsum dolor sit";
819 ```
820
821 See also [`force_format_strings`](#force_format_strings), [`max_width`](#max_width).
822
823 ## `generics_indent`
824
825 Indentation of generics
826
827 - **Default value**: `"Block"`
828 - **Possible values**: `"Block"`, `"Visual"`
829
830 #### `"Block"`:
831
832 ```rust
833 fn lorem<
834     Ipsum: Eq = usize,
835     Dolor: Eq = usize,
836     Sit: Eq = usize,
837     Amet: Eq = usize,
838     Adipiscing: Eq = usize,
839     Consectetur: Eq = usize,
840     Elit: Eq = usize
841 >(ipsum: Ipsum,
842     dolor: Dolor,
843     sit: Sit,
844     amet: Amet,
845     adipiscing: Adipiscing,
846     consectetur: Consectetur,
847     elit: Elit)
848     -> T {
849     // body
850 }
851 ```
852
853 #### `"Visual"`:
854
855 ```rust
856 fn lorem<Ipsum: Eq = usize,
857          Dolor: Eq = usize,
858          Sit: Eq = usize,
859          Amet: Eq = usize,
860          Adipiscing: Eq = usize,
861          Consectetur: Eq = usize,
862          Elit: Eq = usize>
863     (ipsum: Ipsum,
864      dolor: Dolor,
865      sit: Sit,
866      amet: Amet,
867      adipiscing: Adipiscing,
868      consectetur: Consectetur,
869      elit: Elit)
870      -> T {
871     // body
872 }
873 ```
874
875 ## `hard_tabs`
876
877 Use tab characters for indentation, spaces for alignment
878
879 - **Default value**: `false`
880 - **Possible values**: `true`, `false`
881
882 #### `false`:
883
884 ```rust
885 fn lorem() -> usize {
886     42 // spaces before 42
887 }
888 ```
889
890 #### `true`:
891
892 ```rust
893 fn lorem() -> usize {
894         42 // tabs before 42
895 }
896 ```
897
898 See also: [`tab_spaces`](#tab_spaces).
899
900 ## `impl_empty_single_line`
901
902 Put empty-body implementations on a single line
903
904 - **Default value**: `true`
905 - **Possible values**: `true`, `false`
906
907 #### `false`:
908
909 ```rust
910 impl Lorem {
911 }
912 ```
913
914 #### `true`:
915
916 ```rust
917 impl Lorem {}
918 ```
919
920 See also [`item_brace_style`](#item_brace_style).
921
922 ## `indent_match_arms`
923
924 Indent match arms instead of keeping them at the same indentation level as the match keyword
925
926 - **Default value**: `true`
927 - **Possible values**: `true`, `false`
928
929 #### `false`:
930
931 ```rust
932 match lorem {
933 Lorem::Ipsum => (),
934 Lorem::Dolor => (),
935 Lorem::Sit => (),
936 Lorem::Amet => (),
937 }
938 ```
939
940 #### `true`:
941
942 ```rust
943 match lorem {
944     Lorem::Ipsum => (),
945     Lorem::Dolor => (),
946     Lorem::Sit => (),
947     Lorem::Amet => (),
948 }
949 ```
950
951 See also: [`match_block_trailing_comma`](#match_block_trailing_comma), [`wrap_match_arms`](#wrap_match_arms).
952
953 ## `item_brace_style`
954
955 Brace style for structs and enums
956
957 - **Default value**: `"SameLineWhere"`
958 - **Possible values**: `"AlwaysNextLine"`, `"PreferSameLine"`, `"SameLineWhere"`
959
960 #### `"AlwaysNextLine"`:
961
962 ```rust
963 struct Lorem
964 {
965     ipsum: bool,
966 }
967
968 struct Dolor<T>
969     where T: Eq
970 {
971     sit: T,
972 }
973 ```
974
975 #### `"PreferSameLine"`:
976
977 ```rust
978 struct Lorem {
979     ipsum: bool,
980 }
981
982 struct Dolor<T>
983     where T: Eq {
984     sit: T,
985 }
986 ```
987
988 #### `"SameLineWhere"`:
989
990 ```rust
991 struct Lorem {
992     ipsum: bool,
993 }
994
995 struct Dolor<T>
996     where T: Eq
997 {
998     sit: T,
999 }
1000 ```
1001
1002 ## `match_block_trailing_comma`
1003
1004 Put a trailing comma after a block based match arm (non-block arms are not affected)
1005
1006 - **Default value**: `false`
1007 - **Possible values**: `true`, `false`
1008
1009 #### `false`:
1010
1011 ```rust
1012 match lorem {
1013     Lorem::Ipsum => {
1014         println!("ipsum");
1015     }
1016     Lorem::Dolor => println!("dolor"),
1017 }
1018 ```
1019
1020 #### `true`:
1021
1022 ```rust
1023 match lorem {
1024     Lorem::Ipsum => {
1025         println!("ipsum");
1026     },
1027     Lorem::Dolor => println!("dolor"),
1028 }
1029 ```
1030
1031 See also: [`indent_match_arms`](#indent_match_arms), [`trailing_comma`](#trailing_comma), [`wrap_match_arms`](#wrap_match_arms).
1032
1033 ## `max_width`
1034
1035 Maximum width of each line
1036
1037 - **Default value**: `100`
1038 - **Possible values**: any positive integer
1039
1040 See also [`error_on_line_overflow`](#error_on_line_overflow).
1041
1042 ## `newline_style`
1043
1044 Unix or Windows line endings
1045
1046 - **Default value**: `"Unix"`
1047 - **Possible values**: `"Native"`, `"Unix"`, `"Windows"`
1048
1049 ## `normalize_comments`
1050
1051 Convert /* */ comments to // comments where possible
1052
1053 - **Default value**: `false`
1054 - **Possible values**: `true`, `false`
1055
1056 #### `false`:
1057
1058 ```rust
1059 // Lorem ipsum:
1060 fn dolor() -> usize {}
1061
1062 /* sit amet: */
1063 fn adipiscing() -> usize {}
1064 ```
1065
1066 #### `true`:
1067
1068 ```rust
1069 // Lorem ipsum:
1070 fn dolor() -> usize {}
1071
1072 // sit amet:
1073 fn adipiscing() -> usize {}
1074 ```
1075
1076 ## `reorder_imported_names`
1077
1078 Reorder lists of names in import statements alphabetically
1079
1080 - **Default value**: `false`
1081 - **Possible values**: `true`, `false`
1082
1083 #### `false`:
1084
1085 ```rust
1086 use super::{lorem, ipsum, dolor, sit};
1087 ```
1088
1089 #### `true`:
1090
1091 ```rust
1092 use super::{dolor, ipsum, lorem, sit};
1093 ```
1094
1095 See also [`reorder_imports`](#reorder_imports).
1096
1097 ## `reorder_imports`
1098
1099 Reorder import statements alphabetically
1100
1101 - **Default value**: `false`
1102 - **Possible values**: `true`, `false`
1103
1104 #### `false`:
1105
1106 ```rust
1107 use lorem;
1108 use ipsum;
1109 use dolor;
1110 use sit;
1111 ```
1112
1113 #### `true`:
1114
1115 ```rust
1116 use dolor;
1117 use ipsum;
1118 use lorem;
1119 use sit;
1120 ```
1121
1122 See also [`reorder_imported_names`](#reorder_imported_names), [`reorder_imports_in_group`](#reorder_imports_in_group).
1123
1124 ## `reorder_imports_in_group`
1125
1126 Reorder import statements in group
1127
1128 - **Default value**: `false`
1129 - **Possible values**: `true`, `false`
1130
1131 **Note:** This option takes effect only when [`reorder_imports`](#reorder_imports) is set to `true`.
1132
1133 #### `false`:
1134
1135 ```rust
1136 use std::mem;
1137 use std::io;
1138
1139 use lorem;
1140 use ipsum;
1141 use dolor;
1142 use sit;
1143 ```
1144
1145 #### `true`:
1146
1147 ```rust
1148 use std::io;
1149 use std::mem;
1150
1151 use dolor;
1152 use ipsum;
1153 use lorem;
1154 use sit;
1155 ```
1156
1157 See also [`reorder_imports`](#reorder_imports).
1158
1159 ## `single_line_if_else_max_width`
1160
1161 Maximum line length for single line if-else expressions.
1162
1163 - **Default value**: `50`
1164 - **Possible values**: any positive integer
1165
1166 **Note:** A value of `0` results in if-else expressions being broken regardless of their line's width.
1167
1168 #### Lines shorter than `single_line_if_else_max_width`:
1169 ```rust
1170 let lorem = if ipsum { dolor } else { sit };
1171 ```
1172
1173 #### Lines longer than `single_line_if_else_max_width`:
1174 ```rust
1175 let lorem = if ipsum {
1176     dolor
1177 } else {
1178     sit
1179 };
1180 ```
1181
1182 See also: [`control_brace_style`](#control_brace_style).
1183
1184 ## `skip_children`
1185
1186 Don't reformat out of line modules
1187
1188 - **Default value**: `false`
1189 - **Possible values**: `true`, `false`
1190
1191 ## `space_after_bound_colon`
1192
1193 Leave a space after the colon in a trait or lifetime bound
1194
1195 - **Default value**: `true`
1196 - **Possible values**: `true`, `false`
1197
1198 #### `false`:
1199
1200 ```rust
1201 fn lorem<T:Eq>(t: T) {
1202     // body
1203 }
1204 ```
1205
1206 #### `true`:
1207
1208 ```rust
1209 fn lorem<T: Eq>(t: T) {
1210     // body
1211 }
1212 ```
1213
1214 See also: [`space_before_bound`](#space_before_bound).
1215
1216 ## `space_after_struct_lit_field_colon`
1217
1218 Leave a space after the colon in a struct literal field
1219
1220 - **Default value**: `true`
1221 - **Possible values**: `true`, `false`
1222
1223 #### `false`:
1224
1225 ```rust
1226 let lorem = Lorem {
1227     ipsum:dolor,
1228     sit:amet,
1229 };
1230 ```
1231
1232 #### `true`:
1233
1234 ```rust
1235 let lorem = Lorem {
1236     ipsum: dolor,
1237     sit: amet,
1238 };
1239 ```
1240
1241 See also: [`space_before_struct_lit_field_colon`](#space_before_struct_lit_field_colon).
1242
1243 ## `space_after_type_annotation_colon`
1244
1245 Leave a space after the colon in a type annotation
1246
1247 - **Default value**: `true`
1248 - **Possible values**: `true`, `false`
1249
1250 #### `false`:
1251
1252 ```rust
1253 fn lorem<T: Eq>(t:T) {
1254     let ipsum:Dolor = sit;
1255 }
1256 ```
1257
1258 #### `true`:
1259
1260 ```rust
1261 fn lorem<T: Eq>(t: T) {
1262     let ipsum: Dolor = sit;
1263 }
1264 ```
1265
1266 See also: [`space_before_type_annotation`](#space_before_type_annotation).
1267
1268 ## `space_before_bound`
1269
1270 Leave a space before the colon in a trait or lifetime bound
1271
1272 - **Default value**: `false`
1273 - **Possible values**: `true`, `false`
1274
1275 #### `false`:
1276
1277 ```rust
1278 fn lorem<T: Eq>(t: T) {
1279     let ipsum: Dolor = sit;
1280 }
1281 ```
1282
1283 #### `true`:
1284
1285 ```rust
1286 fn lorem<T : Eq>(t: T) {
1287     let ipsum: Dolor = sit;
1288 }
1289 ```
1290
1291 See also: [`space_after_bound_colon`](#space_after_bound_colon).
1292
1293 ## `space_before_struct_lit_field_colon`
1294
1295 Leave a space before the colon in a struct literal field
1296
1297 - **Default value**: `false`
1298 - **Possible values**: `true`, `false`
1299
1300 #### `false`:
1301
1302 ```rust
1303 let lorem = Lorem {
1304     ipsum: dolor,
1305     sit: amet,
1306 };
1307 ```
1308
1309 #### `true`:
1310
1311 ```rust
1312 let lorem = Lorem {
1313     ipsum : dolor,
1314     sit : amet,
1315 };
1316 ```
1317
1318 See also: [`space_after_struct_lit_field_colon`](#space_after_struct_lit_field_colon).
1319
1320 ## `space_before_type_annotation`
1321
1322 Leave a space before the colon in a type annotation
1323
1324 - **Default value**: `false`
1325 - **Possible values**: `true`, `false`
1326
1327 #### `false`:
1328
1329 ```rust
1330 fn lorem<T: Eq>(t: T) {
1331     let ipsum: Dolor = sit;
1332 }
1333 ```
1334
1335 #### `true`:
1336
1337 ```rust
1338 fn lorem<T: Eq>(t : T) {
1339     let ipsum : Dolor = sit;
1340 }
1341 ```
1342
1343 See also: [`space_after_type_annotation_colon`](#space_after_type_annotation_colon).
1344
1345 ## `spaces_around_ranges`
1346
1347 Put spaces around the .. and ... range operators
1348
1349 - **Default value**: `false`
1350 - **Possible values**: `true`, `false`
1351
1352 #### `false`:
1353
1354 ```rust
1355 let lorem = 0..10;
1356 ```
1357
1358 #### `true`:
1359
1360 ```rust
1361 let lorem = 0 .. 10;
1362 ```
1363
1364 ## `spaces_within_angle_brackets`
1365
1366 Put spaces within non-empty generic arguments
1367
1368 - **Default value**: `false`
1369 - **Possible values**: `true`, `false`
1370
1371 #### `false`:
1372
1373 ```rust
1374 fn lorem<T: Eq>(t: T) {
1375     // body
1376 }
1377 ```
1378
1379 #### `true`:
1380
1381 ```rust
1382 fn lorem< T: Eq >(t: T) {
1383     // body
1384 }
1385 ```
1386
1387 See also: [`spaces_within_parens`](#spaces_within_parens), [`spaces_within_square_brackets`](#spaces_within_square_brackets).
1388
1389 ## `spaces_within_parens`
1390
1391 Put spaces within non-empty parentheses
1392
1393 - **Default value**: `false`
1394 - **Possible values**: `true`, `false`
1395
1396 #### `false`:
1397
1398 ```rust
1399 fn lorem<T: Eq>(t: T) {
1400     let lorem = (ipsum, dolor);
1401 }
1402 ```
1403
1404 #### `true`:
1405
1406 ```rust
1407 fn lorem<T: Eq>( t: T ) {
1408     let lorem = ( ipsum, dolor );
1409 }
1410 ```
1411
1412 See also: [`spaces_within_angle_brackets`](#spaces_within_angle_brackets), [`spaces_within_square_brackets`](#spaces_within_square_brackets).
1413
1414 ## `spaces_within_square_brackets`
1415
1416 Put spaces within non-empty square brackets
1417
1418 - **Default value**: `false`
1419 - **Possible values**: `true`, `false`
1420
1421 #### `false`:
1422
1423 ```rust
1424 let lorem: [usize; 2] = [ipsum, dolor];
1425 ```
1426
1427 #### `true`:
1428
1429 ```rust
1430 let lorem: [ usize; 2 ] = [ ipsum, dolor ];
1431 ```
1432
1433 See also: [`spaces_within_parens`](#spaces_within_parens), [`spaces_within_angle_brackets`](#spaces_within_angle_brackets).
1434
1435 ## `struct_lit_multiline_style`
1436
1437 Multiline style on literal structs
1438
1439 - **Default value**: `"PreferSingle"`
1440 - **Possible values**: `"ForceMulti"`, `"PreferSingle"`
1441
1442 #### `"ForceMulti"`:
1443
1444 ```rust
1445 let lorem = Lorem {
1446     ipsum: dolor,
1447     sit: amet,
1448 };
1449 ```
1450
1451 #### `"PreferSingle"`:
1452
1453 ```rust
1454 let lorem = Lorem { ipsum: dolor, sit: amet };
1455 ```
1456
1457 See also: [`struct_lit_style`](#struct_lit_style), [`struct_lit_width`](#struct_lit_width).
1458
1459 ## `struct_lit_style`
1460
1461 Style of struct definition
1462
1463 - **Default value**: `"Block"`
1464 - **Possible values**: `"Block"`, `"Visual"`
1465
1466 #### `"Block"`:
1467
1468 ```rust
1469 let lorem = Lorem {
1470     ipsum: dolor,
1471     sit: amet,
1472 };
1473 ```
1474
1475 #### `"Visual"`:
1476
1477 ```rust
1478 let lorem = Lorem { ipsum: dolor,
1479                     sit: amet, };
1480 ```
1481
1482 See also: [`struct_lit_multiline_style`](#struct_lit_multiline_style), [`struct_lit_style`](#struct_lit_style).
1483
1484 ## `struct_lit_width`
1485
1486 Maximum width in the body of a struct lit before falling back to vertical formatting
1487
1488 - **Default value**: `18`
1489 - **Possible values**: any positive integer
1490
1491 **Note:** A value of `0` results in vertical formatting being applied regardless of a line's width.
1492
1493 #### Lines shorter than `struct_lit_width`:
1494 ```rust
1495 let lorem = Lorem { ipsum: dolor, sit: amet };
1496 ```
1497
1498 #### Lines longer than `struct_lit_width`:
1499 See [`struct_lit_style`](#struct_lit_style).
1500
1501 See also: [`struct_lit_multiline_style`](#struct_lit_multiline_style), [`struct_lit_style`](#struct_lit_style).
1502
1503 ## `struct_variant_width`
1504
1505 Maximum width in the body of a struct variant before falling back to vertical formatting
1506
1507 - **Default value**: `35`
1508 - **Possible values**: any positive integer
1509
1510 **Note:** A value of `0` results in vertical formatting being applied regardless of a line's width.
1511
1512 #### Struct variants shorter than `struct_variant_width`:
1513 ```rust
1514 enum Lorem {
1515     Ipsum,
1516     Dolor(bool),
1517     Sit { amet: Consectetur, adipiscing: Elit },
1518 }
1519 ```
1520
1521 #### Struct variants longer than `struct_variant_width`:
1522 ```rust
1523 enum Lorem {
1524     Ipsum,
1525     Dolor(bool),
1526     Sit {
1527         amet: Consectetur,
1528         adipiscing: Elit,
1529     },
1530 }
1531 ```
1532
1533 ## `tab_spaces`
1534
1535 Number of spaces per tab
1536
1537 - **Default value**: `4`
1538 - **Possible values**: any positive integer
1539
1540 #### `2`:
1541
1542 ```rust
1543 fn lorem() {
1544   let ipsum = dolor();
1545   let sit = vec![
1546     "amet consectetur adipiscing elit."
1547   ];
1548 }
1549 ```
1550
1551 #### `4`:
1552
1553 ```rust
1554 fn lorem() {
1555     let ipsum = dolor();
1556     let sit = vec![
1557         "amet consectetur adipiscing elit."
1558     ];
1559 }
1560 ```
1561
1562 See also: [`hard_tabs`](#hard_tabs).
1563
1564 ## `take_source_hints`
1565
1566 Retain some formatting characteristics from the source code
1567
1568 - **Default value**: `false`
1569 - **Possible values**: `true`, `false`
1570
1571 #### `false`:
1572
1573 ```rust
1574 lorem
1575     .ipsum()
1576     .dolor(|| { sit.amet().consectetur().adipiscing().elit(); });
1577 ```
1578
1579 #### `true`:
1580
1581 ```rust
1582 lorem
1583     .ipsum()
1584     .dolor(|| {
1585                sit.amet()
1586                    .consectetur()
1587                    .adipiscing()
1588                    .elit();
1589            });
1590 ```
1591
1592 Note: This only applies if the call chain within the inner closure had already been formatted on separate lines before running rustfmt.
1593
1594 ## `trailing_comma`
1595
1596 How to handle trailing commas for lists
1597
1598 - **Default value**: `"Vertical"`
1599 - **Possible values**: `"Always"`, `"Never"`, `"Vertical"`
1600
1601 #### `"Always"`:
1602
1603 ```rust
1604 let Lorem { ipsum, dolor, sit, } = amet;
1605 let Lorem {
1606     ipsum,
1607     dolor,
1608     sit,
1609     amet,
1610     consectetur,
1611     adipiscing,
1612 } = elit;
1613 ```
1614
1615 #### `"Never"`:
1616
1617 ```rust
1618 let Lorem { ipsum, dolor, sit } = amet;
1619 let Lorem {
1620     ipsum,
1621     dolor,
1622     sit,
1623     amet,
1624     consectetur,
1625     adipiscing
1626 } = elit;
1627 ```
1628
1629 #### `"Vertical"`:
1630
1631 ```rust
1632 let Lorem { ipsum, dolor, sit } = amet;
1633 let Lorem {
1634     ipsum,
1635     dolor,
1636     sit,
1637     amet,
1638     consectetur,
1639     adipiscing,
1640 } = elit;
1641 ```
1642
1643 See also: [`match_block_trailing_comma`](#match_block_trailing_comma).
1644
1645 ## `type_punctuation_density`
1646
1647 Determines if `+` or `=` are wrapped in spaces in the punctuation of types
1648
1649 - **Default value**: `"Wide"`
1650 - **Possible values**: `"Compressed"`, `"Wide"`
1651
1652 #### `"Compressed"`:
1653
1654 ```rust
1655 fn lorem<Ipsum: Dolor+Sit=Amet>() {
1656         // body
1657 }
1658 ```
1659
1660 #### `"Wide"`:
1661
1662 ```rust
1663 fn lorem<Ipsum: Dolor + Sit = Amet>() {
1664         // body
1665 }
1666 ```
1667
1668 ## `use_try_shorthand`
1669
1670 Replace uses of the try! macro by the ? shorthand
1671
1672 - **Default value**: `false`
1673 - **Possible values**: `true`, `false`
1674
1675 #### `false`:
1676
1677 ```rust
1678 let lorem = try!(ipsum.map(|dolor|dolor.sit()));
1679 ```
1680
1681 #### `true`:
1682
1683 ```rust
1684 let lorem = ipsum.map(|dolor| dolor.sit())?;
1685 ```
1686
1687 ## `where_density`
1688
1689 Density of a where clause
1690
1691 - **Default value**: `"CompressedIfEmpty"`
1692 - **Possible values**: `"Compressed"`, `"CompressedIfEmpty"`, `"Tall"`, `"Vertical"`
1693
1694 #### `"Compressed"`:
1695
1696 ```rust
1697 trait Lorem {
1698     fn ipsum<Dolor>(dolor: Dolor) -> Sit where Dolor: Eq;
1699
1700     fn ipsum<Dolor>(dolor: Dolor) -> Sit where Dolor: Eq {
1701         // body
1702     }
1703 }
1704 ```
1705
1706 #### `"CompressedIfEmpty"`:
1707
1708 ```rust
1709 trait Lorem {
1710     fn ipsum<Dolor>(dolor: Dolor) -> Sit where Dolor: Eq;
1711
1712     fn ipsum<Dolor>(dolor: Dolor) -> Sit
1713         where Dolor: Eq
1714     {
1715         // body
1716     }
1717 }
1718 ```
1719
1720 #### `"Tall"`:
1721
1722 ```rust
1723 trait Lorem {
1724     fn ipsum<Dolor>(dolor: Dolor) -> Sit
1725         where Dolor: Eq;
1726
1727     fn ipsum<Dolor>(dolor: Dolor) -> Sit
1728         where Dolor: Eq
1729     {
1730         // body
1731     }
1732 }
1733 ```
1734
1735 **Note:** `where_density = "Tall"` currently produces the same output as `where_density = "Vertical"`.
1736
1737 #### `"Vertical"`:
1738
1739 ```rust
1740 trait Lorem {
1741     fn ipsum<Dolor>(dolor: Dolor) -> Sit
1742         where Dolor: Eq;
1743
1744     fn ipsum<Dolor>(dolor: Dolor) -> Sit
1745         where Dolor: Eq
1746     {
1747         // body
1748     }
1749 }
1750 ```
1751
1752 **Note:** `where_density = "Vertical"` currently produces the same output as `where_density = "Tall"`.
1753
1754 See also: [`where_layout`](#where_layout), [`where_pred_indent`](#where_pred_indent), [`where_style`](#where_style).
1755
1756 ## `where_layout`
1757
1758 Element layout inside a where clause
1759
1760 - **Default value**: `"Vertical"`
1761 - **Possible values**: `"Horizontal"`, `"HorizontalVertical"`, `"Mixed"`, `"Vertical"`
1762
1763 #### `"Horizontal"`:
1764
1765 ```rust
1766 fn lorem<Ipsum, Dolor>(ipsum: Ipsum, dolor: Dolor)
1767     where Ipsum: IpsumDolorSitAmet, Dolor: DolorSitAmetConsectetur
1768 {
1769     // body
1770 }
1771
1772 fn lorem<Ipsum, Dolor, Sit, Amet>(ipsum: Ipsum, dolor: Dolor, sit: Sit, amet: Amet)
1773     where Ipsum: IpsumDolorSitAmet, Dolor: DolorSitAmetConsectetur, Sit: SitAmetConsecteturAdipiscing, Amet: AmetConsecteturAdipiscingElit
1774 {
1775     // body
1776 }
1777 ```
1778
1779 #### `"HorizontalVertical"`:
1780
1781 ```rust
1782 fn lorem<Ipsum, Dolor>(ipsum: Ipsum, dolor: Dolor)
1783     where Ipsum: IpsumDolorSitAmet, Dolor: DolorSitAmetConsectetur
1784 {
1785     // body
1786 }
1787
1788 fn lorem<Ipsum, Dolor, Sit, Amet>(ipsum: Ipsum, dolor: Dolor, sit: Sit, amet: Amet)
1789     where Ipsum: IpsumDolorSitAmet,
1790           Dolor: DolorSitAmetConsectetur,
1791           Sit: SitAmetConsecteturAdipiscing,
1792           Amet: AmetConsecteturAdipiscingElit
1793 {
1794     // body
1795 }
1796 ```
1797
1798 #### `"Mixed"`:
1799
1800 ```rust
1801 fn lorem<Ipsum, Dolor>(ipsum: Ipsum, dolor: Dolor)
1802     where Ipsum: IpsumDolorSitAmet, Dolor: DolorSitAmetConsectetur
1803 {
1804     // body
1805 }
1806
1807 fn lorem<Ipsum, Dolor, Sit, Amet>(ipsum: Ipsum, dolor: Dolor, sit: Sit, amet: Amet)
1808     where Ipsum: IpsumDolorSitAmet, Dolor: DolorSitAmetConsectetur,
1809           Sit: SitAmetConsecteturAdipiscing, Amet: AmetConsecteturAdipiscingElit
1810 {
1811     // body
1812 }
1813 ```
1814
1815 #### `"Vertical"`:
1816
1817 ```rust
1818 fn lorem<Ipsum, Dolor>(ipsum: Ipsum, dolor: Dolor)
1819     where Ipsum: IpsumDolorSitAmet,
1820           Dolor: DolorSitAmetConsectetur
1821 {
1822     // body
1823 }
1824
1825 fn lorem<Ipsum, Dolor, Sit, Amet>(ipsum: Ipsum, dolor: Dolor, sit: Sit, amet: Amet)
1826     where Ipsum: IpsumDolorSitAmet,
1827           Dolor: DolorSitAmetConsectetur,
1828           Sit: SitAmetConsecteturAdipiscing,
1829           Amet: AmetConsecteturAdipiscingElit
1830 {
1831     // body
1832 }
1833 ```
1834
1835 See also: [`where_density`](#where_density), [`where_pred_indent`](#where_pred_indent), [`where_style`](#where_style).
1836
1837 ## `where_pred_indent`
1838
1839 Indentation style of a where predicate
1840
1841 - **Default value**: `"Visual"`
1842 - **Possible values**: `"Block"`, `"Visual"`
1843
1844 #### `"Block"`:
1845
1846 ```rust
1847 fn lorem<Ipsum, Dolor, Sit, Amet>() -> T
1848     where Ipsum: Eq,
1849         Dolor: Eq,
1850         Sit: Eq,
1851         Amet: Eq
1852 {
1853     // body
1854 }
1855 ```
1856
1857 #### `"Visual"`:
1858
1859 ```rust
1860 fn lorem<Ipsum, Dolor, Sit, Amet>() -> T
1861     where Ipsum: Eq,
1862           Dolor: Eq,
1863           Sit: Eq,
1864           Amet: Eq
1865 {
1866     // body
1867 }
1868 ```
1869
1870 See also: [`where_density`](#where_density), [`where_layout`](#where_layout), [`where_style`](#where_style).
1871
1872 ## `where_style`
1873
1874 Overall strategy for where clauses
1875
1876 - **Default value**: `"Rfc"`
1877 - **Possible values**: `"Rfc"`, `"Legacy"`
1878
1879 #### `"Rfc"`:
1880
1881 ```rust
1882 fn lorem<Ipsum, Dolor, Sit, Amet>() -> T
1883 where
1884     Ipsum: Eq,
1885     Dolor: Eq,
1886     Sit: Eq,
1887     Amet: Eq,
1888 {
1889     // body
1890 }
1891 ```
1892
1893 #### `"Legacy"`:
1894
1895 ```rust
1896 fn lorem<Ipsum, Dolor, Sit, Amet>() -> T
1897     where Ipsum: Eq,
1898           Dolor: Eq,
1899           Sit: Eq,
1900           Amet: Eq
1901 {
1902     // body
1903 }
1904 ```
1905
1906 See also: [`where_density`](#where_density), [`where_layout`](#where_layout), [`where_pred_indent`](#where_pred_indent).
1907
1908 ## `wrap_comments`
1909
1910 Break comments to fit on the line
1911
1912 - **Default value**: `false`
1913 - **Possible values**: `true`, `false`
1914
1915 #### `false`:
1916
1917 ```rust
1918 // 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.
1919 ```
1920
1921 #### `true`:
1922
1923 ```rust
1924 // Lorem ipsum dolor sit amet, consectetur adipiscing elit,
1925 // sed do eiusmod tempor incididunt ut labore et dolore
1926 // magna aliqua. Ut enim ad minim veniam, quis nostrud
1927 // exercitation ullamco laboris nisi ut aliquip ex ea
1928 // commodo consequat.
1929 ```
1930
1931 ## `wrap_match_arms`
1932
1933 Wrap multiline match arms in blocks
1934
1935 - **Default value**: `true`
1936 - **Possible values**: `true`, `false`
1937
1938 #### `false`:
1939
1940 ```rust
1941 match lorem {
1942     true => {
1943         let ipsum = dolor;
1944         println!("{}", ipsum);
1945     }
1946     false => {
1947         println!("{}", sit)
1948     }
1949 }
1950 ```
1951
1952 #### `true`:
1953
1954 ```rust
1955 match lorem {
1956     true => {
1957         let ipsum = dolor;
1958         println!("{}", ipsum);
1959     }
1960     false => println!("{}", sit),
1961 }
1962 ```
1963
1964 See also: [`indent_match_arms`](#indent_match_arms), [`match_block_trailing_comma`](#match_block_trailing_comma).
1965
1966 ## `write_mode`
1967
1968 What Write Mode to use when none is supplied: Replace, Overwrite, Display, Diff, Coverage
1969
1970 - **Default value**: `"Replace"`
1971 - **Possible values**: `"Checkstyle"`, `"Coverage"`, `"Diff"`, `"Display"`, `"Overwrite"`, `"Plain"`, `"Replace"`