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