]> git.lizzy.rs Git - rust.git/blob - Configurations.md
Add struct_field_align_threshold for vertical alignment
[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 ## `struct_field_align_threshold`
1213
1214 The maximum diff of width between struct fields to be aligned with each other.
1215
1216 - **Default value** : 0
1217 - **Possible values**: any positive integer
1218
1219 #### `0`:
1220
1221 ```rust
1222 struct Foo {
1223     x: u32,
1224     yy: u32,
1225     zzz: u32,
1226 }
1227 ```
1228
1229 #### `20`:
1230
1231 ```rust
1232 struct Foo {
1233     x:   u32,
1234     yy:  u32,
1235     zzz: u32,
1236 }
1237 ```
1238
1239 ## `space_after_struct_lit_field_colon`
1240
1241 Leave a space after the colon in a struct literal field
1242
1243 - **Default value**: `true`
1244 - **Possible values**: `true`, `false`
1245
1246 #### `false`:
1247
1248 ```rust
1249 let lorem = Lorem {
1250     ipsum:dolor,
1251     sit:amet,
1252 };
1253 ```
1254
1255 #### `true`:
1256
1257 ```rust
1258 let lorem = Lorem {
1259     ipsum: dolor,
1260     sit: amet,
1261 };
1262 ```
1263
1264 See also: [`space_before_struct_lit_field_colon`](#space_before_struct_lit_field_colon).
1265
1266 ## `space_after_type_annotation_colon`
1267
1268 Leave a space after the colon in a type annotation
1269
1270 - **Default value**: `true`
1271 - **Possible values**: `true`, `false`
1272
1273 #### `false`:
1274
1275 ```rust
1276 fn lorem<T: Eq>(t:T) {
1277     let ipsum:Dolor = sit;
1278 }
1279 ```
1280
1281 #### `true`:
1282
1283 ```rust
1284 fn lorem<T: Eq>(t: T) {
1285     let ipsum: Dolor = sit;
1286 }
1287 ```
1288
1289 See also: [`space_before_type_annotation`](#space_before_type_annotation).
1290
1291 ## `space_before_bound`
1292
1293 Leave a space before the colon in a trait or lifetime bound
1294
1295 - **Default value**: `false`
1296 - **Possible values**: `true`, `false`
1297
1298 #### `false`:
1299
1300 ```rust
1301 fn lorem<T: Eq>(t: T) {
1302     let ipsum: Dolor = sit;
1303 }
1304 ```
1305
1306 #### `true`:
1307
1308 ```rust
1309 fn lorem<T : Eq>(t: T) {
1310     let ipsum: Dolor = sit;
1311 }
1312 ```
1313
1314 See also: [`space_after_bound_colon`](#space_after_bound_colon).
1315
1316 ## `space_before_struct_lit_field_colon`
1317
1318 Leave a space before the colon in a struct literal field
1319
1320 - **Default value**: `false`
1321 - **Possible values**: `true`, `false`
1322
1323 #### `false`:
1324
1325 ```rust
1326 let lorem = Lorem {
1327     ipsum: dolor,
1328     sit: amet,
1329 };
1330 ```
1331
1332 #### `true`:
1333
1334 ```rust
1335 let lorem = Lorem {
1336     ipsum : dolor,
1337     sit : amet,
1338 };
1339 ```
1340
1341 See also: [`space_after_struct_lit_field_colon`](#space_after_struct_lit_field_colon).
1342
1343 ## `space_before_type_annotation`
1344
1345 Leave a space before the colon in a type annotation
1346
1347 - **Default value**: `false`
1348 - **Possible values**: `true`, `false`
1349
1350 #### `false`:
1351
1352 ```rust
1353 fn lorem<T: Eq>(t: T) {
1354     let ipsum: Dolor = sit;
1355 }
1356 ```
1357
1358 #### `true`:
1359
1360 ```rust
1361 fn lorem<T: Eq>(t : T) {
1362     let ipsum : Dolor = sit;
1363 }
1364 ```
1365
1366 See also: [`space_after_type_annotation_colon`](#space_after_type_annotation_colon).
1367
1368 ## `spaces_around_ranges`
1369
1370 Put spaces around the .. and ... range operators
1371
1372 - **Default value**: `false`
1373 - **Possible values**: `true`, `false`
1374
1375 #### `false`:
1376
1377 ```rust
1378 let lorem = 0..10;
1379 ```
1380
1381 #### `true`:
1382
1383 ```rust
1384 let lorem = 0 .. 10;
1385 ```
1386
1387 ## `spaces_within_angle_brackets`
1388
1389 Put spaces within non-empty generic arguments
1390
1391 - **Default value**: `false`
1392 - **Possible values**: `true`, `false`
1393
1394 #### `false`:
1395
1396 ```rust
1397 fn lorem<T: Eq>(t: T) {
1398     // body
1399 }
1400 ```
1401
1402 #### `true`:
1403
1404 ```rust
1405 fn lorem< T: Eq >(t: T) {
1406     // body
1407 }
1408 ```
1409
1410 See also: [`spaces_within_parens`](#spaces_within_parens), [`spaces_within_square_brackets`](#spaces_within_square_brackets).
1411
1412 ## `spaces_within_parens`
1413
1414 Put spaces within non-empty parentheses
1415
1416 - **Default value**: `false`
1417 - **Possible values**: `true`, `false`
1418
1419 #### `false`:
1420
1421 ```rust
1422 fn lorem<T: Eq>(t: T) {
1423     let lorem = (ipsum, dolor);
1424 }
1425 ```
1426
1427 #### `true`:
1428
1429 ```rust
1430 fn lorem<T: Eq>( t: T ) {
1431     let lorem = ( ipsum, dolor );
1432 }
1433 ```
1434
1435 See also: [`spaces_within_angle_brackets`](#spaces_within_angle_brackets), [`spaces_within_square_brackets`](#spaces_within_square_brackets).
1436
1437 ## `spaces_within_square_brackets`
1438
1439 Put spaces within non-empty square brackets
1440
1441 - **Default value**: `false`
1442 - **Possible values**: `true`, `false`
1443
1444 #### `false`:
1445
1446 ```rust
1447 let lorem: [usize; 2] = [ipsum, dolor];
1448 ```
1449
1450 #### `true`:
1451
1452 ```rust
1453 let lorem: [ usize; 2 ] = [ ipsum, dolor ];
1454 ```
1455
1456 See also: [`spaces_within_parens`](#spaces_within_parens), [`spaces_within_angle_brackets`](#spaces_within_angle_brackets).
1457
1458 ## `struct_lit_multiline_style`
1459
1460 Multiline style on literal structs
1461
1462 - **Default value**: `"PreferSingle"`
1463 - **Possible values**: `"ForceMulti"`, `"PreferSingle"`
1464
1465 #### `"ForceMulti"`:
1466
1467 ```rust
1468 let lorem = Lorem {
1469     ipsum: dolor,
1470     sit: amet,
1471 };
1472 ```
1473
1474 #### `"PreferSingle"`:
1475
1476 ```rust
1477 let lorem = Lorem { ipsum: dolor, sit: amet };
1478 ```
1479
1480 See also: [`struct_lit_style`](#struct_lit_style), [`struct_lit_width`](#struct_lit_width).
1481
1482 ## `struct_lit_style`
1483
1484 Style of struct definition
1485
1486 - **Default value**: `"Block"`
1487 - **Possible values**: `"Block"`, `"Visual"`
1488
1489 #### `"Block"`:
1490
1491 ```rust
1492 let lorem = Lorem {
1493     ipsum: dolor,
1494     sit: amet,
1495 };
1496 ```
1497
1498 #### `"Visual"`:
1499
1500 ```rust
1501 let lorem = Lorem { ipsum: dolor,
1502                     sit: amet, };
1503 ```
1504
1505 See also: [`struct_lit_multiline_style`](#struct_lit_multiline_style), [`struct_lit_style`](#struct_lit_style).
1506
1507 ## `struct_lit_width`
1508
1509 Maximum width in the body of a struct lit before falling back to vertical formatting
1510
1511 - **Default value**: `18`
1512 - **Possible values**: any positive integer
1513
1514 **Note:** A value of `0` results in vertical formatting being applied regardless of a line's width.
1515
1516 #### Lines shorter than `struct_lit_width`:
1517 ```rust
1518 let lorem = Lorem { ipsum: dolor, sit: amet };
1519 ```
1520
1521 #### Lines longer than `struct_lit_width`:
1522 See [`struct_lit_style`](#struct_lit_style).
1523
1524 See also: [`struct_lit_multiline_style`](#struct_lit_multiline_style), [`struct_lit_style`](#struct_lit_style).
1525
1526 ## `struct_variant_width`
1527
1528 Maximum width in the body of a struct variant before falling back to vertical formatting
1529
1530 - **Default value**: `35`
1531 - **Possible values**: any positive integer
1532
1533 **Note:** A value of `0` results in vertical formatting being applied regardless of a line's width.
1534
1535 #### Struct variants shorter than `struct_variant_width`:
1536 ```rust
1537 enum Lorem {
1538     Ipsum,
1539     Dolor(bool),
1540     Sit { amet: Consectetur, adipiscing: Elit },
1541 }
1542 ```
1543
1544 #### Struct variants longer than `struct_variant_width`:
1545 ```rust
1546 enum Lorem {
1547     Ipsum,
1548     Dolor(bool),
1549     Sit {
1550         amet: Consectetur,
1551         adipiscing: Elit,
1552     },
1553 }
1554 ```
1555
1556 ## `tab_spaces`
1557
1558 Number of spaces per tab
1559
1560 - **Default value**: `4`
1561 - **Possible values**: any positive integer
1562
1563 #### `2`:
1564
1565 ```rust
1566 fn lorem() {
1567   let ipsum = dolor();
1568   let sit = vec![
1569     "amet consectetur adipiscing elit."
1570   ];
1571 }
1572 ```
1573
1574 #### `4`:
1575
1576 ```rust
1577 fn lorem() {
1578     let ipsum = dolor();
1579     let sit = vec![
1580         "amet consectetur adipiscing elit."
1581     ];
1582 }
1583 ```
1584
1585 See also: [`hard_tabs`](#hard_tabs).
1586
1587 ## `take_source_hints`
1588
1589 Retain some formatting characteristics from the source code
1590
1591 - **Default value**: `false`
1592 - **Possible values**: `true`, `false`
1593
1594 #### `false`:
1595
1596 ```rust
1597 lorem
1598     .ipsum()
1599     .dolor(|| { sit.amet().consectetur().adipiscing().elit(); });
1600 ```
1601
1602 #### `true`:
1603
1604 ```rust
1605 lorem
1606     .ipsum()
1607     .dolor(|| {
1608                sit.amet()
1609                    .consectetur()
1610                    .adipiscing()
1611                    .elit();
1612            });
1613 ```
1614
1615 Note: This only applies if the call chain within the inner closure had already been formatted on separate lines before running rustfmt.
1616
1617 ## `trailing_comma`
1618
1619 How to handle trailing commas for lists
1620
1621 - **Default value**: `"Vertical"`
1622 - **Possible values**: `"Always"`, `"Never"`, `"Vertical"`
1623
1624 #### `"Always"`:
1625
1626 ```rust
1627 let Lorem { ipsum, dolor, sit, } = amet;
1628 let Lorem {
1629     ipsum,
1630     dolor,
1631     sit,
1632     amet,
1633     consectetur,
1634     adipiscing,
1635 } = elit;
1636 ```
1637
1638 #### `"Never"`:
1639
1640 ```rust
1641 let Lorem { ipsum, dolor, sit } = amet;
1642 let Lorem {
1643     ipsum,
1644     dolor,
1645     sit,
1646     amet,
1647     consectetur,
1648     adipiscing
1649 } = elit;
1650 ```
1651
1652 #### `"Vertical"`:
1653
1654 ```rust
1655 let Lorem { ipsum, dolor, sit } = amet;
1656 let Lorem {
1657     ipsum,
1658     dolor,
1659     sit,
1660     amet,
1661     consectetur,
1662     adipiscing,
1663 } = elit;
1664 ```
1665
1666 See also: [`match_block_trailing_comma`](#match_block_trailing_comma).
1667
1668 ## `type_punctuation_density`
1669
1670 Determines if `+` or `=` are wrapped in spaces in the punctuation of types
1671
1672 - **Default value**: `"Wide"`
1673 - **Possible values**: `"Compressed"`, `"Wide"`
1674
1675 #### `"Compressed"`:
1676
1677 ```rust
1678 fn lorem<Ipsum: Dolor+Sit=Amet>() {
1679         // body
1680 }
1681 ```
1682
1683 #### `"Wide"`:
1684
1685 ```rust
1686 fn lorem<Ipsum: Dolor + Sit = Amet>() {
1687         // body
1688 }
1689 ```
1690
1691 ## `use_try_shorthand`
1692
1693 Replace uses of the try! macro by the ? shorthand
1694
1695 - **Default value**: `false`
1696 - **Possible values**: `true`, `false`
1697
1698 #### `false`:
1699
1700 ```rust
1701 let lorem = try!(ipsum.map(|dolor|dolor.sit()));
1702 ```
1703
1704 #### `true`:
1705
1706 ```rust
1707 let lorem = ipsum.map(|dolor| dolor.sit())?;
1708 ```
1709
1710 ## `where_density`
1711
1712 Density of a where clause
1713
1714 - **Default value**: `"CompressedIfEmpty"`
1715 - **Possible values**: `"Compressed"`, `"CompressedIfEmpty"`, `"Tall"`, `"Vertical"`
1716
1717 #### `"Compressed"`:
1718
1719 ```rust
1720 trait Lorem {
1721     fn ipsum<Dolor>(dolor: Dolor) -> Sit where Dolor: Eq;
1722
1723     fn ipsum<Dolor>(dolor: Dolor) -> Sit where Dolor: Eq {
1724         // body
1725     }
1726 }
1727 ```
1728
1729 #### `"CompressedIfEmpty"`:
1730
1731 ```rust
1732 trait Lorem {
1733     fn ipsum<Dolor>(dolor: Dolor) -> Sit where Dolor: Eq;
1734
1735     fn ipsum<Dolor>(dolor: Dolor) -> Sit
1736         where Dolor: Eq
1737     {
1738         // body
1739     }
1740 }
1741 ```
1742
1743 #### `"Tall"`:
1744
1745 ```rust
1746 trait Lorem {
1747     fn ipsum<Dolor>(dolor: Dolor) -> Sit
1748         where Dolor: Eq;
1749
1750     fn ipsum<Dolor>(dolor: Dolor) -> Sit
1751         where Dolor: Eq
1752     {
1753         // body
1754     }
1755 }
1756 ```
1757
1758 **Note:** `where_density = "Tall"` currently produces the same output as `where_density = "Vertical"`.
1759
1760 #### `"Vertical"`:
1761
1762 ```rust
1763 trait Lorem {
1764     fn ipsum<Dolor>(dolor: Dolor) -> Sit
1765         where Dolor: Eq;
1766
1767     fn ipsum<Dolor>(dolor: Dolor) -> Sit
1768         where Dolor: Eq
1769     {
1770         // body
1771     }
1772 }
1773 ```
1774
1775 **Note:** `where_density = "Vertical"` currently produces the same output as `where_density = "Tall"`.
1776
1777 See also: [`where_layout`](#where_layout), [`where_pred_indent`](#where_pred_indent), [`where_style`](#where_style).
1778
1779 ## `where_layout`
1780
1781 Element layout inside a where clause
1782
1783 - **Default value**: `"Vertical"`
1784 - **Possible values**: `"Horizontal"`, `"HorizontalVertical"`, `"Mixed"`, `"Vertical"`
1785
1786 #### `"Horizontal"`:
1787
1788 ```rust
1789 fn lorem<Ipsum, Dolor>(ipsum: Ipsum, dolor: Dolor)
1790     where Ipsum: IpsumDolorSitAmet, Dolor: DolorSitAmetConsectetur
1791 {
1792     // body
1793 }
1794
1795 fn lorem<Ipsum, Dolor, Sit, Amet>(ipsum: Ipsum, dolor: Dolor, sit: Sit, amet: Amet)
1796     where Ipsum: IpsumDolorSitAmet, Dolor: DolorSitAmetConsectetur, Sit: SitAmetConsecteturAdipiscing, Amet: AmetConsecteturAdipiscingElit
1797 {
1798     // body
1799 }
1800 ```
1801
1802 #### `"HorizontalVertical"`:
1803
1804 ```rust
1805 fn lorem<Ipsum, Dolor>(ipsum: Ipsum, dolor: Dolor)
1806     where Ipsum: IpsumDolorSitAmet, Dolor: DolorSitAmetConsectetur
1807 {
1808     // body
1809 }
1810
1811 fn lorem<Ipsum, Dolor, Sit, Amet>(ipsum: Ipsum, dolor: Dolor, sit: Sit, amet: Amet)
1812     where Ipsum: IpsumDolorSitAmet,
1813           Dolor: DolorSitAmetConsectetur,
1814           Sit: SitAmetConsecteturAdipiscing,
1815           Amet: AmetConsecteturAdipiscingElit
1816 {
1817     // body
1818 }
1819 ```
1820
1821 #### `"Mixed"`:
1822
1823 ```rust
1824 fn lorem<Ipsum, Dolor>(ipsum: Ipsum, dolor: Dolor)
1825     where Ipsum: IpsumDolorSitAmet, Dolor: DolorSitAmetConsectetur
1826 {
1827     // body
1828 }
1829
1830 fn lorem<Ipsum, Dolor, Sit, Amet>(ipsum: Ipsum, dolor: Dolor, sit: Sit, amet: Amet)
1831     where Ipsum: IpsumDolorSitAmet, Dolor: DolorSitAmetConsectetur,
1832           Sit: SitAmetConsecteturAdipiscing, Amet: AmetConsecteturAdipiscingElit
1833 {
1834     // body
1835 }
1836 ```
1837
1838 #### `"Vertical"`:
1839
1840 ```rust
1841 fn lorem<Ipsum, Dolor>(ipsum: Ipsum, dolor: Dolor)
1842     where Ipsum: IpsumDolorSitAmet,
1843           Dolor: DolorSitAmetConsectetur
1844 {
1845     // body
1846 }
1847
1848 fn lorem<Ipsum, Dolor, Sit, Amet>(ipsum: Ipsum, dolor: Dolor, sit: Sit, amet: Amet)
1849     where Ipsum: IpsumDolorSitAmet,
1850           Dolor: DolorSitAmetConsectetur,
1851           Sit: SitAmetConsecteturAdipiscing,
1852           Amet: AmetConsecteturAdipiscingElit
1853 {
1854     // body
1855 }
1856 ```
1857
1858 See also: [`where_density`](#where_density), [`where_pred_indent`](#where_pred_indent), [`where_style`](#where_style).
1859
1860 ## `where_pred_indent`
1861
1862 Indentation style of a where predicate
1863
1864 - **Default value**: `"Visual"`
1865 - **Possible values**: `"Block"`, `"Visual"`
1866
1867 #### `"Block"`:
1868
1869 ```rust
1870 fn lorem<Ipsum, Dolor, Sit, Amet>() -> T
1871     where Ipsum: Eq,
1872         Dolor: Eq,
1873         Sit: Eq,
1874         Amet: Eq
1875 {
1876     // body
1877 }
1878 ```
1879
1880 #### `"Visual"`:
1881
1882 ```rust
1883 fn lorem<Ipsum, Dolor, Sit, Amet>() -> T
1884     where Ipsum: Eq,
1885           Dolor: Eq,
1886           Sit: Eq,
1887           Amet: Eq
1888 {
1889     // body
1890 }
1891 ```
1892
1893 See also: [`where_density`](#where_density), [`where_layout`](#where_layout), [`where_style`](#where_style).
1894
1895 ## `where_style`
1896
1897 Overall strategy for where clauses
1898
1899 - **Default value**: `"Rfc"`
1900 - **Possible values**: `"Rfc"`, `"Legacy"`
1901
1902 #### `"Rfc"`:
1903
1904 ```rust
1905 fn lorem<Ipsum, Dolor, Sit, Amet>() -> T
1906 where
1907     Ipsum: Eq,
1908     Dolor: Eq,
1909     Sit: Eq,
1910     Amet: Eq,
1911 {
1912     // body
1913 }
1914 ```
1915
1916 #### `"Legacy"`:
1917
1918 ```rust
1919 fn lorem<Ipsum, Dolor, Sit, Amet>() -> T
1920     where Ipsum: Eq,
1921           Dolor: Eq,
1922           Sit: Eq,
1923           Amet: Eq
1924 {
1925     // body
1926 }
1927 ```
1928
1929 See also: [`where_density`](#where_density), [`where_layout`](#where_layout), [`where_pred_indent`](#where_pred_indent).
1930
1931 ## `wrap_comments`
1932
1933 Break comments to fit on the line
1934
1935 - **Default value**: `false`
1936 - **Possible values**: `true`, `false`
1937
1938 #### `false`:
1939
1940 ```rust
1941 // 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.
1942 ```
1943
1944 #### `true`:
1945
1946 ```rust
1947 // Lorem ipsum dolor sit amet, consectetur adipiscing elit,
1948 // sed do eiusmod tempor incididunt ut labore et dolore
1949 // magna aliqua. Ut enim ad minim veniam, quis nostrud
1950 // exercitation ullamco laboris nisi ut aliquip ex ea
1951 // commodo consequat.
1952 ```
1953
1954 ## `wrap_match_arms`
1955
1956 Wrap multiline match arms in blocks
1957
1958 - **Default value**: `true`
1959 - **Possible values**: `true`, `false`
1960
1961 #### `false`:
1962
1963 ```rust
1964 match lorem {
1965     true => {
1966         let ipsum = dolor;
1967         println!("{}", ipsum);
1968     }
1969     false => {
1970         println!("{}", sit)
1971     }
1972 }
1973 ```
1974
1975 #### `true`:
1976
1977 ```rust
1978 match lorem {
1979     true => {
1980         let ipsum = dolor;
1981         println!("{}", ipsum);
1982     }
1983     false => println!("{}", sit),
1984 }
1985 ```
1986
1987 See also: [`indent_match_arms`](#indent_match_arms), [`match_block_trailing_comma`](#match_block_trailing_comma).
1988
1989 ## `write_mode`
1990
1991 What Write Mode to use when none is supplied: Replace, Overwrite, Display, Diff, Coverage
1992
1993 - **Default value**: `"Replace"`
1994 - **Possible values**: `"Checkstyle"`, `"Coverage"`, `"Diff"`, `"Display"`, `"Overwrite"`, `"Plain"`, `"Replace"`