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