]> git.lizzy.rs Git - rust.git/blob - Configurations.md
Merge pull request #1787 from euclio/errors
[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 ## `item_brace_style`
983
984 Brace style for structs and enums
985
986 - **Default value**: `"SameLineWhere"`
987 - **Possible values**: `"AlwaysNextLine"`, `"PreferSameLine"`, `"SameLineWhere"`
988
989 #### `"AlwaysNextLine"`:
990
991 ```rust
992 struct Lorem
993 {
994     ipsum: bool,
995 }
996
997 struct Dolor<T>
998     where T: Eq
999 {
1000     sit: T,
1001 }
1002 ```
1003
1004 #### `"PreferSameLine"`:
1005
1006 ```rust
1007 struct Lorem {
1008     ipsum: bool,
1009 }
1010
1011 struct Dolor<T>
1012     where T: Eq {
1013     sit: T,
1014 }
1015 ```
1016
1017 #### `"SameLineWhere"`:
1018
1019 ```rust
1020 struct Lorem {
1021     ipsum: bool,
1022 }
1023
1024 struct Dolor<T>
1025     where T: Eq
1026 {
1027     sit: T,
1028 }
1029 ```
1030
1031 ## `match_block_trailing_comma`
1032
1033 Put a trailing comma after a block based match arm (non-block arms are not affected)
1034
1035 - **Default value**: `false`
1036 - **Possible values**: `true`, `false`
1037
1038 #### `false`:
1039
1040 ```rust
1041 match lorem {
1042     Lorem::Ipsum => {
1043         println!("ipsum");
1044     }
1045     Lorem::Dolor => println!("dolor"),
1046 }
1047 ```
1048
1049 #### `true`:
1050
1051 ```rust
1052 match lorem {
1053     Lorem::Ipsum => {
1054         println!("ipsum");
1055     },
1056     Lorem::Dolor => println!("dolor"),
1057 }
1058 ```
1059
1060 See also: [`indent_match_arms`](#indent_match_arms), [`trailing_comma`](#trailing_comma), [`wrap_match_arms`](#wrap_match_arms).
1061
1062 ## `max_width`
1063
1064 Maximum width of each line
1065
1066 - **Default value**: `100`
1067 - **Possible values**: any positive integer
1068
1069 See also [`error_on_line_overflow`](#error_on_line_overflow).
1070
1071 ## `newline_style`
1072
1073 Unix or Windows line endings
1074
1075 - **Default value**: `"Unix"`
1076 - **Possible values**: `"Native"`, `"Unix"`, `"Windows"`
1077
1078 ## `normalize_comments`
1079
1080 Convert /* */ comments to // comments where possible
1081
1082 - **Default value**: `false`
1083 - **Possible values**: `true`, `false`
1084
1085 #### `false`:
1086
1087 ```rust
1088 // Lorem ipsum:
1089 fn dolor() -> usize {}
1090
1091 /* sit amet: */
1092 fn adipiscing() -> usize {}
1093 ```
1094
1095 #### `true`:
1096
1097 ```rust
1098 // Lorem ipsum:
1099 fn dolor() -> usize {}
1100
1101 // sit amet:
1102 fn adipiscing() -> usize {}
1103 ```
1104
1105 ## `reorder_imported_names`
1106
1107 Reorder lists of names in import statements alphabetically
1108
1109 - **Default value**: `false`
1110 - **Possible values**: `true`, `false`
1111
1112 #### `false`:
1113
1114 ```rust
1115 use super::{lorem, ipsum, dolor, sit};
1116 ```
1117
1118 #### `true`:
1119
1120 ```rust
1121 use super::{dolor, ipsum, lorem, sit};
1122 ```
1123
1124 See also [`reorder_imports`](#reorder_imports).
1125
1126 ## `reorder_imports`
1127
1128 Reorder import statements alphabetically
1129
1130 - **Default value**: `false`
1131 - **Possible values**: `true`, `false`
1132
1133 #### `false`:
1134
1135 ```rust
1136 use lorem;
1137 use ipsum;
1138 use dolor;
1139 use sit;
1140 ```
1141
1142 #### `true`:
1143
1144 ```rust
1145 use dolor;
1146 use ipsum;
1147 use lorem;
1148 use sit;
1149 ```
1150
1151 See also [`reorder_imported_names`](#reorder_imported_names), [`reorder_imports_in_group`](#reorder_imports_in_group).
1152
1153 ## `reorder_imports_in_group`
1154
1155 Reorder import statements in group
1156
1157 - **Default value**: `false`
1158 - **Possible values**: `true`, `false`
1159
1160 **Note:** This option takes effect only when [`reorder_imports`](#reorder_imports) is set to `true`.
1161
1162 #### `false`:
1163
1164 ```rust
1165 use std::mem;
1166 use std::io;
1167
1168 use lorem;
1169 use ipsum;
1170 use dolor;
1171 use sit;
1172 ```
1173
1174 #### `true`:
1175
1176 ```rust
1177 use std::io;
1178 use std::mem;
1179
1180 use dolor;
1181 use ipsum;
1182 use lorem;
1183 use sit;
1184 ```
1185
1186 See also [`reorder_imports`](#reorder_imports).
1187
1188 ## `single_line_if_else_max_width`
1189
1190 Maximum line length for single line if-else expressions.
1191
1192 - **Default value**: `50`
1193 - **Possible values**: any positive integer
1194
1195 **Note:** A value of `0` results in if-else expressions being broken regardless of their line's width.
1196
1197 #### Lines shorter than `single_line_if_else_max_width`:
1198 ```rust
1199 let lorem = if ipsum { dolor } else { sit };
1200 ```
1201
1202 #### Lines longer than `single_line_if_else_max_width`:
1203 ```rust
1204 let lorem = if ipsum {
1205     dolor
1206 } else {
1207     sit
1208 };
1209 ```
1210
1211 See also: [`control_brace_style`](#control_brace_style).
1212
1213 ## `skip_children`
1214
1215 Don't reformat out of line modules
1216
1217 - **Default value**: `false`
1218 - **Possible values**: `true`, `false`
1219
1220 ## `space_after_bound_colon`
1221
1222 Leave a space after the colon in a trait or lifetime bound
1223
1224 - **Default value**: `true`
1225 - **Possible values**: `true`, `false`
1226
1227 #### `false`:
1228
1229 ```rust
1230 fn lorem<T:Eq>(t: T) {
1231     // body
1232 }
1233 ```
1234
1235 #### `true`:
1236
1237 ```rust
1238 fn lorem<T: Eq>(t: T) {
1239     // body
1240 }
1241 ```
1242
1243 See also: [`space_before_bound`](#space_before_bound).
1244
1245 ## `struct_field_align_threshold`
1246
1247 The maximum diff of width between struct fields to be aligned with each other.
1248
1249 - **Default value** : 0
1250 - **Possible values**: any positive integer
1251
1252 #### `0`:
1253
1254 ```rust
1255 struct Foo {
1256     x: u32,
1257     yy: u32,
1258     zzz: u32,
1259 }
1260 ```
1261
1262 #### `20`:
1263
1264 ```rust
1265 struct Foo {
1266     x:   u32,
1267     yy:  u32,
1268     zzz: u32,
1269 }
1270 ```
1271
1272 ## `space_after_struct_lit_field_colon`
1273
1274 Leave a space after the colon in a struct literal field
1275
1276 - **Default value**: `true`
1277 - **Possible values**: `true`, `false`
1278
1279 #### `false`:
1280
1281 ```rust
1282 let lorem = Lorem {
1283     ipsum:dolor,
1284     sit:amet,
1285 };
1286 ```
1287
1288 #### `true`:
1289
1290 ```rust
1291 let lorem = Lorem {
1292     ipsum: dolor,
1293     sit: amet,
1294 };
1295 ```
1296
1297 See also: [`space_before_struct_lit_field_colon`](#space_before_struct_lit_field_colon).
1298
1299 ## `space_after_type_annotation_colon`
1300
1301 Leave a space after the colon in a type annotation
1302
1303 - **Default value**: `true`
1304 - **Possible values**: `true`, `false`
1305
1306 #### `false`:
1307
1308 ```rust
1309 fn lorem<T: Eq>(t:T) {
1310     let ipsum:Dolor = sit;
1311 }
1312 ```
1313
1314 #### `true`:
1315
1316 ```rust
1317 fn lorem<T: Eq>(t: T) {
1318     let ipsum: Dolor = sit;
1319 }
1320 ```
1321
1322 See also: [`space_before_type_annotation`](#space_before_type_annotation).
1323
1324 ## `space_before_bound`
1325
1326 Leave a space before the colon in a trait or lifetime bound
1327
1328 - **Default value**: `false`
1329 - **Possible values**: `true`, `false`
1330
1331 #### `false`:
1332
1333 ```rust
1334 fn lorem<T: Eq>(t: T) {
1335     let ipsum: Dolor = sit;
1336 }
1337 ```
1338
1339 #### `true`:
1340
1341 ```rust
1342 fn lorem<T : Eq>(t: T) {
1343     let ipsum: Dolor = sit;
1344 }
1345 ```
1346
1347 See also: [`space_after_bound_colon`](#space_after_bound_colon).
1348
1349 ## `space_before_struct_lit_field_colon`
1350
1351 Leave a space before the colon in a struct literal field
1352
1353 - **Default value**: `false`
1354 - **Possible values**: `true`, `false`
1355
1356 #### `false`:
1357
1358 ```rust
1359 let lorem = Lorem {
1360     ipsum: dolor,
1361     sit: amet,
1362 };
1363 ```
1364
1365 #### `true`:
1366
1367 ```rust
1368 let lorem = Lorem {
1369     ipsum : dolor,
1370     sit : amet,
1371 };
1372 ```
1373
1374 See also: [`space_after_struct_lit_field_colon`](#space_after_struct_lit_field_colon).
1375
1376 ## `space_before_type_annotation`
1377
1378 Leave a space before the colon in a type annotation
1379
1380 - **Default value**: `false`
1381 - **Possible values**: `true`, `false`
1382
1383 #### `false`:
1384
1385 ```rust
1386 fn lorem<T: Eq>(t: T) {
1387     let ipsum: Dolor = sit;
1388 }
1389 ```
1390
1391 #### `true`:
1392
1393 ```rust
1394 fn lorem<T: Eq>(t : T) {
1395     let ipsum : Dolor = sit;
1396 }
1397 ```
1398
1399 See also: [`space_after_type_annotation_colon`](#space_after_type_annotation_colon).
1400
1401 ## `spaces_around_ranges`
1402
1403 Put spaces around the .. and ... range operators
1404
1405 - **Default value**: `false`
1406 - **Possible values**: `true`, `false`
1407
1408 #### `false`:
1409
1410 ```rust
1411 let lorem = 0..10;
1412 ```
1413
1414 #### `true`:
1415
1416 ```rust
1417 let lorem = 0 .. 10;
1418 ```
1419
1420 ## `spaces_within_angle_brackets`
1421
1422 Put spaces within non-empty generic arguments
1423
1424 - **Default value**: `false`
1425 - **Possible values**: `true`, `false`
1426
1427 #### `false`:
1428
1429 ```rust
1430 fn lorem<T: Eq>(t: T) {
1431     // body
1432 }
1433 ```
1434
1435 #### `true`:
1436
1437 ```rust
1438 fn lorem< T: Eq >(t: T) {
1439     // body
1440 }
1441 ```
1442
1443 See also: [`spaces_within_parens`](#spaces_within_parens), [`spaces_within_square_brackets`](#spaces_within_square_brackets).
1444
1445 ## `spaces_within_parens`
1446
1447 Put spaces within non-empty parentheses
1448
1449 - **Default value**: `false`
1450 - **Possible values**: `true`, `false`
1451
1452 #### `false`:
1453
1454 ```rust
1455 fn lorem<T: Eq>(t: T) {
1456     let lorem = (ipsum, dolor);
1457 }
1458 ```
1459
1460 #### `true`:
1461
1462 ```rust
1463 fn lorem<T: Eq>( t: T ) {
1464     let lorem = ( ipsum, dolor );
1465 }
1466 ```
1467
1468 See also: [`spaces_within_angle_brackets`](#spaces_within_angle_brackets), [`spaces_within_square_brackets`](#spaces_within_square_brackets).
1469
1470 ## `spaces_within_square_brackets`
1471
1472 Put spaces within non-empty square brackets
1473
1474 - **Default value**: `false`
1475 - **Possible values**: `true`, `false`
1476
1477 #### `false`:
1478
1479 ```rust
1480 let lorem: [usize; 2] = [ipsum, dolor];
1481 ```
1482
1483 #### `true`:
1484
1485 ```rust
1486 let lorem: [ usize; 2 ] = [ ipsum, dolor ];
1487 ```
1488
1489 See also: [`spaces_within_parens`](#spaces_within_parens), [`spaces_within_angle_brackets`](#spaces_within_angle_brackets).
1490
1491 ## `struct_lit_multiline_style`
1492
1493 Multiline style on literal structs
1494
1495 - **Default value**: `"PreferSingle"`
1496 - **Possible values**: `"ForceMulti"`, `"PreferSingle"`
1497
1498 #### `"ForceMulti"`:
1499
1500 ```rust
1501 let lorem = Lorem {
1502     ipsum: dolor,
1503     sit: amet,
1504 };
1505 ```
1506
1507 #### `"PreferSingle"`:
1508
1509 ```rust
1510 let lorem = Lorem { ipsum: dolor, sit: amet };
1511 ```
1512
1513 See also: [`struct_lit_style`](#struct_lit_style), [`struct_lit_width`](#struct_lit_width).
1514
1515 ## `struct_lit_style`
1516
1517 Style of struct definition
1518
1519 - **Default value**: `"Block"`
1520 - **Possible values**: `"Block"`, `"Visual"`
1521
1522 #### `"Block"`:
1523
1524 ```rust
1525 let lorem = Lorem {
1526     ipsum: dolor,
1527     sit: amet,
1528 };
1529 ```
1530
1531 #### `"Visual"`:
1532
1533 ```rust
1534 let lorem = Lorem { ipsum: dolor,
1535                     sit: amet, };
1536 ```
1537
1538 See also: [`struct_lit_multiline_style`](#struct_lit_multiline_style), [`struct_lit_style`](#struct_lit_style).
1539
1540 ## `struct_lit_width`
1541
1542 Maximum width in the body of a struct lit before falling back to vertical formatting
1543
1544 - **Default value**: `18`
1545 - **Possible values**: any positive integer
1546
1547 **Note:** A value of `0` results in vertical formatting being applied regardless of a line's width.
1548
1549 #### Lines shorter than `struct_lit_width`:
1550 ```rust
1551 let lorem = Lorem { ipsum: dolor, sit: amet };
1552 ```
1553
1554 #### Lines longer than `struct_lit_width`:
1555 See [`struct_lit_style`](#struct_lit_style).
1556
1557 See also: [`struct_lit_multiline_style`](#struct_lit_multiline_style), [`struct_lit_style`](#struct_lit_style).
1558
1559 ## `struct_variant_width`
1560
1561 Maximum width in the body of a struct variant before falling back to vertical formatting
1562
1563 - **Default value**: `35`
1564 - **Possible values**: any positive integer
1565
1566 **Note:** A value of `0` results in vertical formatting being applied regardless of a line's width.
1567
1568 #### Struct variants shorter than `struct_variant_width`:
1569 ```rust
1570 enum Lorem {
1571     Ipsum,
1572     Dolor(bool),
1573     Sit { amet: Consectetur, adipiscing: Elit },
1574 }
1575 ```
1576
1577 #### Struct variants longer than `struct_variant_width`:
1578 ```rust
1579 enum Lorem {
1580     Ipsum,
1581     Dolor(bool),
1582     Sit {
1583         amet: Consectetur,
1584         adipiscing: Elit,
1585     },
1586 }
1587 ```
1588
1589 ## `tab_spaces`
1590
1591 Number of spaces per tab
1592
1593 - **Default value**: `4`
1594 - **Possible values**: any positive integer
1595
1596 #### `2`:
1597
1598 ```rust
1599 fn lorem() {
1600   let ipsum = dolor();
1601   let sit = vec![
1602     "amet consectetur adipiscing elit."
1603   ];
1604 }
1605 ```
1606
1607 #### `4`:
1608
1609 ```rust
1610 fn lorem() {
1611     let ipsum = dolor();
1612     let sit = vec![
1613         "amet consectetur adipiscing elit."
1614     ];
1615 }
1616 ```
1617
1618 See also: [`hard_tabs`](#hard_tabs).
1619
1620 ## `take_source_hints`
1621
1622 Retain some formatting characteristics from the source code
1623
1624 - **Default value**: `false`
1625 - **Possible values**: `true`, `false`
1626
1627 #### `false`:
1628
1629 ```rust
1630 lorem
1631     .ipsum()
1632     .dolor(|| { sit.amet().consectetur().adipiscing().elit(); });
1633 ```
1634
1635 #### `true`:
1636
1637 ```rust
1638 lorem
1639     .ipsum()
1640     .dolor(|| {
1641                sit.amet()
1642                    .consectetur()
1643                    .adipiscing()
1644                    .elit();
1645            });
1646 ```
1647
1648 Note: This only applies if the call chain within the inner closure had already been formatted on separate lines before running rustfmt.
1649
1650 ## `trailing_comma`
1651
1652 How to handle trailing commas for lists
1653
1654 - **Default value**: `"Vertical"`
1655 - **Possible values**: `"Always"`, `"Never"`, `"Vertical"`
1656
1657 #### `"Always"`:
1658
1659 ```rust
1660 let Lorem { ipsum, dolor, sit, } = amet;
1661 let Lorem {
1662     ipsum,
1663     dolor,
1664     sit,
1665     amet,
1666     consectetur,
1667     adipiscing,
1668 } = elit;
1669 ```
1670
1671 #### `"Never"`:
1672
1673 ```rust
1674 let Lorem { ipsum, dolor, sit } = amet;
1675 let Lorem {
1676     ipsum,
1677     dolor,
1678     sit,
1679     amet,
1680     consectetur,
1681     adipiscing
1682 } = elit;
1683 ```
1684
1685 #### `"Vertical"`:
1686
1687 ```rust
1688 let Lorem { ipsum, dolor, sit } = amet;
1689 let Lorem {
1690     ipsum,
1691     dolor,
1692     sit,
1693     amet,
1694     consectetur,
1695     adipiscing,
1696 } = elit;
1697 ```
1698
1699 See also: [`match_block_trailing_comma`](#match_block_trailing_comma).
1700
1701 ## `trailing_semicolon`
1702
1703 Add trailing semicolon after break, continue and return
1704
1705 - **Default value**: `true`
1706 - **Possible values**: `true`, `false`
1707
1708 #### `true`:
1709 ```rust
1710 fn foo() -> usize {
1711     return 0;
1712 }
1713 ```
1714
1715 #### `false`:
1716 ```rust
1717 fn foo() -> usize {
1718     return 0
1719 }
1720 ```
1721
1722 ## `type_punctuation_density`
1723
1724 Determines if `+` or `=` are wrapped in spaces in the punctuation of types
1725
1726 - **Default value**: `"Wide"`
1727 - **Possible values**: `"Compressed"`, `"Wide"`
1728
1729 #### `"Compressed"`:
1730
1731 ```rust
1732 fn lorem<Ipsum: Dolor+Sit=Amet>() {
1733         // body
1734 }
1735 ```
1736
1737 #### `"Wide"`:
1738
1739 ```rust
1740 fn lorem<Ipsum: Dolor + Sit = Amet>() {
1741         // body
1742 }
1743 ```
1744
1745 ## `use_try_shorthand`
1746
1747 Replace uses of the try! macro by the ? shorthand
1748
1749 - **Default value**: `false`
1750 - **Possible values**: `true`, `false`
1751
1752 #### `false`:
1753
1754 ```rust
1755 let lorem = try!(ipsum.map(|dolor|dolor.sit()));
1756 ```
1757
1758 #### `true`:
1759
1760 ```rust
1761 let lorem = ipsum.map(|dolor| dolor.sit())?;
1762 ```
1763
1764 ## `where_density`
1765
1766 Density of a where clause
1767
1768 - **Default value**: `"CompressedIfEmpty"`
1769 - **Possible values**: `"Compressed"`, `"CompressedIfEmpty"`, `"Tall"`, `"Vertical"`
1770
1771 #### `"Compressed"`:
1772
1773 ```rust
1774 trait Lorem {
1775     fn ipsum<Dolor>(dolor: Dolor) -> Sit where Dolor: Eq;
1776
1777     fn ipsum<Dolor>(dolor: Dolor) -> Sit where Dolor: Eq {
1778         // body
1779     }
1780 }
1781 ```
1782
1783 #### `"CompressedIfEmpty"`:
1784
1785 ```rust
1786 trait Lorem {
1787     fn ipsum<Dolor>(dolor: Dolor) -> Sit where Dolor: Eq;
1788
1789     fn ipsum<Dolor>(dolor: Dolor) -> Sit
1790         where Dolor: Eq
1791     {
1792         // body
1793     }
1794 }
1795 ```
1796
1797 #### `"Tall"`:
1798
1799 ```rust
1800 trait Lorem {
1801     fn ipsum<Dolor>(dolor: Dolor) -> Sit
1802         where Dolor: Eq;
1803
1804     fn ipsum<Dolor>(dolor: Dolor) -> Sit
1805         where Dolor: Eq
1806     {
1807         // body
1808     }
1809 }
1810 ```
1811
1812 **Note:** `where_density = "Tall"` currently produces the same output as `where_density = "Vertical"`.
1813
1814 #### `"Vertical"`:
1815
1816 ```rust
1817 trait Lorem {
1818     fn ipsum<Dolor>(dolor: Dolor) -> Sit
1819         where Dolor: Eq;
1820
1821     fn ipsum<Dolor>(dolor: Dolor) -> Sit
1822         where Dolor: Eq
1823     {
1824         // body
1825     }
1826 }
1827 ```
1828
1829 **Note:** `where_density = "Vertical"` currently produces the same output as `where_density = "Tall"`.
1830
1831 See also: [`where_layout`](#where_layout), [`where_pred_indent`](#where_pred_indent), [`where_style`](#where_style).
1832
1833 ## `where_layout`
1834
1835 Element layout inside a where clause
1836
1837 - **Default value**: `"Vertical"`
1838 - **Possible values**: `"Horizontal"`, `"HorizontalVertical"`, `"Mixed"`, `"Vertical"`
1839
1840 #### `"Horizontal"`:
1841
1842 ```rust
1843 fn lorem<Ipsum, Dolor>(ipsum: Ipsum, dolor: Dolor)
1844     where Ipsum: IpsumDolorSitAmet, Dolor: DolorSitAmetConsectetur
1845 {
1846     // body
1847 }
1848
1849 fn lorem<Ipsum, Dolor, Sit, Amet>(ipsum: Ipsum, dolor: Dolor, sit: Sit, amet: Amet)
1850     where Ipsum: IpsumDolorSitAmet, Dolor: DolorSitAmetConsectetur, Sit: SitAmetConsecteturAdipiscing, Amet: AmetConsecteturAdipiscingElit
1851 {
1852     // body
1853 }
1854 ```
1855
1856 #### `"HorizontalVertical"`:
1857
1858 ```rust
1859 fn lorem<Ipsum, Dolor>(ipsum: Ipsum, dolor: Dolor)
1860     where Ipsum: IpsumDolorSitAmet, Dolor: DolorSitAmetConsectetur
1861 {
1862     // body
1863 }
1864
1865 fn lorem<Ipsum, Dolor, Sit, Amet>(ipsum: Ipsum, dolor: Dolor, sit: Sit, amet: Amet)
1866     where Ipsum: IpsumDolorSitAmet,
1867           Dolor: DolorSitAmetConsectetur,
1868           Sit: SitAmetConsecteturAdipiscing,
1869           Amet: AmetConsecteturAdipiscingElit
1870 {
1871     // body
1872 }
1873 ```
1874
1875 #### `"Mixed"`:
1876
1877 ```rust
1878 fn lorem<Ipsum, Dolor>(ipsum: Ipsum, dolor: Dolor)
1879     where Ipsum: IpsumDolorSitAmet, Dolor: DolorSitAmetConsectetur
1880 {
1881     // body
1882 }
1883
1884 fn lorem<Ipsum, Dolor, Sit, Amet>(ipsum: Ipsum, dolor: Dolor, sit: Sit, amet: Amet)
1885     where Ipsum: IpsumDolorSitAmet, Dolor: DolorSitAmetConsectetur,
1886           Sit: SitAmetConsecteturAdipiscing, Amet: AmetConsecteturAdipiscingElit
1887 {
1888     // body
1889 }
1890 ```
1891
1892 #### `"Vertical"`:
1893
1894 ```rust
1895 fn lorem<Ipsum, Dolor>(ipsum: Ipsum, dolor: Dolor)
1896     where Ipsum: IpsumDolorSitAmet,
1897           Dolor: DolorSitAmetConsectetur
1898 {
1899     // body
1900 }
1901
1902 fn lorem<Ipsum, Dolor, Sit, Amet>(ipsum: Ipsum, dolor: Dolor, sit: Sit, amet: Amet)
1903     where Ipsum: IpsumDolorSitAmet,
1904           Dolor: DolorSitAmetConsectetur,
1905           Sit: SitAmetConsecteturAdipiscing,
1906           Amet: AmetConsecteturAdipiscingElit
1907 {
1908     // body
1909 }
1910 ```
1911
1912 See also: [`where_density`](#where_density), [`where_pred_indent`](#where_pred_indent), [`where_style`](#where_style).
1913
1914 ## `where_pred_indent`
1915
1916 Indentation style of a where predicate
1917
1918 - **Default value**: `"Visual"`
1919 - **Possible values**: `"Block"`, `"Visual"`
1920
1921 #### `"Block"`:
1922
1923 ```rust
1924 fn lorem<Ipsum, Dolor, Sit, Amet>() -> T
1925     where Ipsum: Eq,
1926         Dolor: Eq,
1927         Sit: Eq,
1928         Amet: Eq
1929 {
1930     // body
1931 }
1932 ```
1933
1934 #### `"Visual"`:
1935
1936 ```rust
1937 fn lorem<Ipsum, Dolor, Sit, Amet>() -> T
1938     where Ipsum: Eq,
1939           Dolor: Eq,
1940           Sit: Eq,
1941           Amet: Eq
1942 {
1943     // body
1944 }
1945 ```
1946
1947 See also: [`where_density`](#where_density), [`where_layout`](#where_layout), [`where_style`](#where_style).
1948
1949 ## `where_style`
1950
1951 Overall strategy for where clauses
1952
1953 - **Default value**: `"Rfc"`
1954 - **Possible values**: `"Rfc"`, `"Legacy"`
1955
1956 #### `"Rfc"`:
1957
1958 ```rust
1959 fn lorem<Ipsum, Dolor, Sit, Amet>() -> T
1960 where
1961     Ipsum: Eq,
1962     Dolor: Eq,
1963     Sit: Eq,
1964     Amet: Eq,
1965 {
1966     // body
1967 }
1968 ```
1969
1970 #### `"Legacy"`:
1971
1972 ```rust
1973 fn lorem<Ipsum, Dolor, Sit, Amet>() -> T
1974     where Ipsum: Eq,
1975           Dolor: Eq,
1976           Sit: Eq,
1977           Amet: Eq
1978 {
1979     // body
1980 }
1981 ```
1982
1983 See also: [`where_density`](#where_density), [`where_layout`](#where_layout), [`where_pred_indent`](#where_pred_indent).
1984
1985 ## `wrap_comments`
1986
1987 Break comments to fit on the line
1988
1989 - **Default value**: `false`
1990 - **Possible values**: `true`, `false`
1991
1992 #### `false`:
1993
1994 ```rust
1995 // 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.
1996 ```
1997
1998 #### `true`:
1999
2000 ```rust
2001 // Lorem ipsum dolor sit amet, consectetur adipiscing elit,
2002 // sed do eiusmod tempor incididunt ut labore et dolore
2003 // magna aliqua. Ut enim ad minim veniam, quis nostrud
2004 // exercitation ullamco laboris nisi ut aliquip ex ea
2005 // commodo consequat.
2006 ```
2007
2008 ## `wrap_match_arms`
2009
2010 Wrap the body of arms in blocks when it does not fit on the same line with the pattern of arms
2011
2012 - **Default value**: `true`
2013 - **Possible values**: `true`, `false`
2014
2015 #### `false`:
2016
2017 ```rust
2018 match lorem {
2019     true =>
2020         foooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo(x),
2021     false => println!("{}", sit),
2022 }
2023 ```
2024
2025 #### `true`:
2026
2027 ```rust
2028 match lorem {
2029     true => {
2030         foooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo(x)
2031     }
2032     false => println!("{}", sit),
2033 }
2034 ```
2035
2036 See also: [`indent_match_arms`](#indent_match_arms), [`match_block_trailing_comma`](#match_block_trailing_comma).
2037
2038 ## `write_mode`
2039
2040 What Write Mode to use when none is supplied: Replace, Overwrite, Display, Diff, Coverage
2041
2042 - **Default value**: `"Replace"`
2043 - **Possible values**: `"Checkstyle"`, `"Coverage"`, `"Diff"`, `"Display"`, `"Overwrite"`, `"Plain"`, `"Replace"`