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