]> git.lizzy.rs Git - rust.git/blob - Configurations.md
Merge pull request #1776 from topecongiro/poor-formatting/index-budget
[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 ## `type_punctuation_density`
1702
1703 Determines if `+` or `=` are wrapped in spaces in the punctuation of types
1704
1705 - **Default value**: `"Wide"`
1706 - **Possible values**: `"Compressed"`, `"Wide"`
1707
1708 #### `"Compressed"`:
1709
1710 ```rust
1711 fn lorem<Ipsum: Dolor+Sit=Amet>() {
1712         // body
1713 }
1714 ```
1715
1716 #### `"Wide"`:
1717
1718 ```rust
1719 fn lorem<Ipsum: Dolor + Sit = Amet>() {
1720         // body
1721 }
1722 ```
1723
1724 ## `use_try_shorthand`
1725
1726 Replace uses of the try! macro by the ? shorthand
1727
1728 - **Default value**: `false`
1729 - **Possible values**: `true`, `false`
1730
1731 #### `false`:
1732
1733 ```rust
1734 let lorem = try!(ipsum.map(|dolor|dolor.sit()));
1735 ```
1736
1737 #### `true`:
1738
1739 ```rust
1740 let lorem = ipsum.map(|dolor| dolor.sit())?;
1741 ```
1742
1743 ## `where_density`
1744
1745 Density of a where clause
1746
1747 - **Default value**: `"CompressedIfEmpty"`
1748 - **Possible values**: `"Compressed"`, `"CompressedIfEmpty"`, `"Tall"`, `"Vertical"`
1749
1750 #### `"Compressed"`:
1751
1752 ```rust
1753 trait Lorem {
1754     fn ipsum<Dolor>(dolor: Dolor) -> Sit where Dolor: Eq;
1755
1756     fn ipsum<Dolor>(dolor: Dolor) -> Sit where Dolor: Eq {
1757         // body
1758     }
1759 }
1760 ```
1761
1762 #### `"CompressedIfEmpty"`:
1763
1764 ```rust
1765 trait Lorem {
1766     fn ipsum<Dolor>(dolor: Dolor) -> Sit where Dolor: Eq;
1767
1768     fn ipsum<Dolor>(dolor: Dolor) -> Sit
1769         where Dolor: Eq
1770     {
1771         // body
1772     }
1773 }
1774 ```
1775
1776 #### `"Tall"`:
1777
1778 ```rust
1779 trait Lorem {
1780     fn ipsum<Dolor>(dolor: Dolor) -> Sit
1781         where Dolor: Eq;
1782
1783     fn ipsum<Dolor>(dolor: Dolor) -> Sit
1784         where Dolor: Eq
1785     {
1786         // body
1787     }
1788 }
1789 ```
1790
1791 **Note:** `where_density = "Tall"` currently produces the same output as `where_density = "Vertical"`.
1792
1793 #### `"Vertical"`:
1794
1795 ```rust
1796 trait Lorem {
1797     fn ipsum<Dolor>(dolor: Dolor) -> Sit
1798         where Dolor: Eq;
1799
1800     fn ipsum<Dolor>(dolor: Dolor) -> Sit
1801         where Dolor: Eq
1802     {
1803         // body
1804     }
1805 }
1806 ```
1807
1808 **Note:** `where_density = "Vertical"` currently produces the same output as `where_density = "Tall"`.
1809
1810 See also: [`where_layout`](#where_layout), [`where_pred_indent`](#where_pred_indent), [`where_style`](#where_style).
1811
1812 ## `where_layout`
1813
1814 Element layout inside a where clause
1815
1816 - **Default value**: `"Vertical"`
1817 - **Possible values**: `"Horizontal"`, `"HorizontalVertical"`, `"Mixed"`, `"Vertical"`
1818
1819 #### `"Horizontal"`:
1820
1821 ```rust
1822 fn lorem<Ipsum, Dolor>(ipsum: Ipsum, dolor: Dolor)
1823     where Ipsum: IpsumDolorSitAmet, Dolor: DolorSitAmetConsectetur
1824 {
1825     // body
1826 }
1827
1828 fn lorem<Ipsum, Dolor, Sit, Amet>(ipsum: Ipsum, dolor: Dolor, sit: Sit, amet: Amet)
1829     where Ipsum: IpsumDolorSitAmet, Dolor: DolorSitAmetConsectetur, Sit: SitAmetConsecteturAdipiscing, Amet: AmetConsecteturAdipiscingElit
1830 {
1831     // body
1832 }
1833 ```
1834
1835 #### `"HorizontalVertical"`:
1836
1837 ```rust
1838 fn lorem<Ipsum, Dolor>(ipsum: Ipsum, dolor: Dolor)
1839     where Ipsum: IpsumDolorSitAmet, Dolor: DolorSitAmetConsectetur
1840 {
1841     // body
1842 }
1843
1844 fn lorem<Ipsum, Dolor, Sit, Amet>(ipsum: Ipsum, dolor: Dolor, sit: Sit, amet: Amet)
1845     where Ipsum: IpsumDolorSitAmet,
1846           Dolor: DolorSitAmetConsectetur,
1847           Sit: SitAmetConsecteturAdipiscing,
1848           Amet: AmetConsecteturAdipiscingElit
1849 {
1850     // body
1851 }
1852 ```
1853
1854 #### `"Mixed"`:
1855
1856 ```rust
1857 fn lorem<Ipsum, Dolor>(ipsum: Ipsum, dolor: Dolor)
1858     where Ipsum: IpsumDolorSitAmet, Dolor: DolorSitAmetConsectetur
1859 {
1860     // body
1861 }
1862
1863 fn lorem<Ipsum, Dolor, Sit, Amet>(ipsum: Ipsum, dolor: Dolor, sit: Sit, amet: Amet)
1864     where Ipsum: IpsumDolorSitAmet, Dolor: DolorSitAmetConsectetur,
1865           Sit: SitAmetConsecteturAdipiscing, Amet: AmetConsecteturAdipiscingElit
1866 {
1867     // body
1868 }
1869 ```
1870
1871 #### `"Vertical"`:
1872
1873 ```rust
1874 fn lorem<Ipsum, Dolor>(ipsum: Ipsum, dolor: Dolor)
1875     where Ipsum: IpsumDolorSitAmet,
1876           Dolor: DolorSitAmetConsectetur
1877 {
1878     // body
1879 }
1880
1881 fn lorem<Ipsum, Dolor, Sit, Amet>(ipsum: Ipsum, dolor: Dolor, sit: Sit, amet: Amet)
1882     where Ipsum: IpsumDolorSitAmet,
1883           Dolor: DolorSitAmetConsectetur,
1884           Sit: SitAmetConsecteturAdipiscing,
1885           Amet: AmetConsecteturAdipiscingElit
1886 {
1887     // body
1888 }
1889 ```
1890
1891 See also: [`where_density`](#where_density), [`where_pred_indent`](#where_pred_indent), [`where_style`](#where_style).
1892
1893 ## `where_pred_indent`
1894
1895 Indentation style of a where predicate
1896
1897 - **Default value**: `"Visual"`
1898 - **Possible values**: `"Block"`, `"Visual"`
1899
1900 #### `"Block"`:
1901
1902 ```rust
1903 fn lorem<Ipsum, Dolor, Sit, Amet>() -> T
1904     where Ipsum: Eq,
1905         Dolor: Eq,
1906         Sit: Eq,
1907         Amet: Eq
1908 {
1909     // body
1910 }
1911 ```
1912
1913 #### `"Visual"`:
1914
1915 ```rust
1916 fn lorem<Ipsum, Dolor, Sit, Amet>() -> T
1917     where Ipsum: Eq,
1918           Dolor: Eq,
1919           Sit: Eq,
1920           Amet: Eq
1921 {
1922     // body
1923 }
1924 ```
1925
1926 See also: [`where_density`](#where_density), [`where_layout`](#where_layout), [`where_style`](#where_style).
1927
1928 ## `where_style`
1929
1930 Overall strategy for where clauses
1931
1932 - **Default value**: `"Rfc"`
1933 - **Possible values**: `"Rfc"`, `"Legacy"`
1934
1935 #### `"Rfc"`:
1936
1937 ```rust
1938 fn lorem<Ipsum, Dolor, Sit, Amet>() -> T
1939 where
1940     Ipsum: Eq,
1941     Dolor: Eq,
1942     Sit: Eq,
1943     Amet: Eq,
1944 {
1945     // body
1946 }
1947 ```
1948
1949 #### `"Legacy"`:
1950
1951 ```rust
1952 fn lorem<Ipsum, Dolor, Sit, Amet>() -> T
1953     where Ipsum: Eq,
1954           Dolor: Eq,
1955           Sit: Eq,
1956           Amet: Eq
1957 {
1958     // body
1959 }
1960 ```
1961
1962 See also: [`where_density`](#where_density), [`where_layout`](#where_layout), [`where_pred_indent`](#where_pred_indent).
1963
1964 ## `wrap_comments`
1965
1966 Break comments to fit on the line
1967
1968 - **Default value**: `false`
1969 - **Possible values**: `true`, `false`
1970
1971 #### `false`:
1972
1973 ```rust
1974 // 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.
1975 ```
1976
1977 #### `true`:
1978
1979 ```rust
1980 // Lorem ipsum dolor sit amet, consectetur adipiscing elit,
1981 // sed do eiusmod tempor incididunt ut labore et dolore
1982 // magna aliqua. Ut enim ad minim veniam, quis nostrud
1983 // exercitation ullamco laboris nisi ut aliquip ex ea
1984 // commodo consequat.
1985 ```
1986
1987 ## `wrap_match_arms`
1988
1989 Wrap multiline match arms in blocks
1990
1991 - **Default value**: `true`
1992 - **Possible values**: `true`, `false`
1993
1994 #### `false`:
1995
1996 ```rust
1997 match lorem {
1998     true => {
1999         let ipsum = dolor;
2000         println!("{}", ipsum);
2001     }
2002     false => {
2003         println!("{}", sit)
2004     }
2005 }
2006 ```
2007
2008 #### `true`:
2009
2010 ```rust
2011 match lorem {
2012     true => {
2013         let ipsum = dolor;
2014         println!("{}", ipsum);
2015     }
2016     false => println!("{}", sit),
2017 }
2018 ```
2019
2020 See also: [`indent_match_arms`](#indent_match_arms), [`match_block_trailing_comma`](#match_block_trailing_comma).
2021
2022 ## `write_mode`
2023
2024 What Write Mode to use when none is supplied: Replace, Overwrite, Display, Diff, Coverage
2025
2026 - **Default value**: `"Replace"`
2027 - **Possible values**: `"Checkstyle"`, `"Coverage"`, `"Diff"`, `"Display"`, `"Overwrite"`, `"Plain"`, `"Replace"`