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