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