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