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