You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: Configurations.md
+16-16Lines changed: 16 additions & 16 deletions
Original file line number
Diff line number
Diff line change
@@ -22,7 +22,7 @@ Below you find a detailed visual guide on all the supported configuration option
22
22
Maximum width of an array literal before falling back to vertical formatting.
23
23
24
24
-**Default value**: `60`
25
-
-**Possible values**: any positive integer that is less than or equal to the value specified for [`max_width`](#max_width)
25
+
-**Possible values**: any nonnegative integer that is less than or equal to the value specified for [`max_width`](#max_width)
26
26
-**Stable**: Yes
27
27
28
28
By default this option is set as a percentage of [`max_width`](#max_width) provided by [`use_small_heuristics`](#use_small_heuristics), but a value set directly for `array_width` will take precedence.
@@ -34,7 +34,7 @@ See also [`max_width`](#max_width) and [`use_small_heuristics`](#use_small_heuri
34
34
Maximum width of the args of a function-like attributes before falling back to vertical formatting.
35
35
36
36
-**Default value**: `70`
37
-
-**Possible values**: any positive integer that is less than or equal to the value specified for [`max_width`](#max_width)
37
+
-**Possible values**: any nonnegative integer that is less than or equal to the value specified for [`max_width`](#max_width)
38
38
-**Stable**: Yes
39
39
40
40
By default this option is set as a percentage of [`max_width`](#max_width) provided by [`use_small_heuristics`](#use_small_heuristics), but a value set directly for `attr_fn_like_width` will take precedence.
@@ -300,7 +300,7 @@ where
300
300
Maximum width of a chain to fit on one line.
301
301
302
302
-**Default value**: `60`
303
-
-**Possible values**: any positive integer that is less than or equal to the value specified for [`max_width`](#max_width)
303
+
-**Possible values**: any nonnegative integer that is less than or equal to the value specified for [`max_width`](#max_width)
304
304
-**Stable**: Yes
305
305
306
306
By default this option is set as a percentage of [`max_width`](#max_width) provided by [`use_small_heuristics`](#use_small_heuristics), but a value set directly for `chain_width` will take precedence.
@@ -428,7 +428,7 @@ fn example() {
428
428
Maximum length of comments. No effect unless `wrap_comments = true`.
429
429
430
430
-**Default value**: `80`
431
-
-**Possible values**: any positive integer
431
+
-**Possible values**: any nonnegative integer
432
432
-**Stable**: No (tracking issue: [#3349](https://github.com/rust-lang/rustfmt/issues/3349))
433
433
434
434
**Note:** A value of `0` results in [`wrap_comments`](#wrap_comments) being applied regardless of a line's width.
@@ -586,7 +586,7 @@ Note that this is not how much whitespace is inserted, but instead the longest v
586
586
doesn't get ignored when aligning.
587
587
588
588
-**Default value** : 0
589
-
-**Possible values**: any positive integer
589
+
-**Possible values**: any nonnegative integer
590
590
-**Stable**: No (tracking issue: [#3372](https://github.com/rust-lang/rustfmt/issues/3372))
591
591
592
592
#### `0` (default):
@@ -764,7 +764,7 @@ See also [`fn_params_layout`](#fn_params_layout)
764
764
Maximum width of the args of a function call before falling back to vertical formatting.
765
765
766
766
-**Default value**: `60`
767
-
-**Possible values**: any positive integer that is less than or equal to the value specified for [`max_width`](#max_width)
767
+
-**Possible values**: any nonnegative integer that is less than or equal to the value specified for [`max_width`](#max_width)
768
768
-**Stable**: Yes
769
769
770
770
By default this option is set as a percentage of [`max_width`](#max_width) provided by [`use_small_heuristics`](#use_small_heuristics), but a value set directly for `fn_call_width` will take precedence.
@@ -1048,7 +1048,7 @@ fn add_one(x: i32) -> i32 {
1048
1048
Max width for code snippets included in doc comments. Only used if [`format_code_in_doc_comments`](#format_code_in_doc_comments) is true.
1049
1049
1050
1050
-**Default value**: `100`
1051
-
-**Possible values**: any positive integer that is less than or equal to the value specified for [`max_width`](#max_width)
1051
+
-**Possible values**: any nonnegative integer that is less than or equal to the value specified for [`max_width`](#max_width)
1052
1052
-**Stable**: No (tracking issue: [#5359](https://github.com/rust-lang/rustfmt/issues/5359))
1053
1053
1054
1054
## `format_generated_files`
@@ -1067,7 +1067,7 @@ This option is currently ignored for stdin (`@generated` in stdin is ignored.)
1067
1067
Number of lines to check for a `@generated` pragma header, starting from the top of the file. Setting this value to `0` will treat all files as non-generated. When`format_generated_files` is `true`, this option has no effect.
1068
1068
1069
1069
-**Default value**: `5`
1070
-
-**Possible values**: any positive integer
1070
+
-**Possible values**: any nonnegative integer
1071
1071
-**Stable**: No (tracking issue: [#5080](https://github.com/rust-lang/rustfmt/issues/5080))
1072
1072
1073
1073
See also [format_generated_files](#format_generated_files) link here.
@@ -1715,7 +1715,7 @@ fn lorem<Ipsum, Dolor, Sit, Amet>() -> T
1715
1715
Write an item and its attribute on the same line if their combined width is below a threshold
1716
1716
1717
1717
-**Default value**: 0
1718
-
-**Possible values**: any positive integer
1718
+
-**Possible values**: any nonnegative integer
1719
1719
-**Stable**: No (tracking issue: [#3343](https://github.com/rust-lang/rustfmt/issues/3343))
1720
1720
1721
1721
### Example
@@ -1939,7 +1939,7 @@ See also: [`trailing_comma`](#trailing_comma), [`match_arm_blocks`](#match_arm_b
1939
1939
Maximum width of each line
1940
1940
1941
1941
-**Default value**: `100`
1942
-
-**Possible values**: any positive integer
1942
+
-**Possible values**: any nonnegative integer
1943
1943
-**Stable**: Yes
1944
1944
1945
1945
See also [`error_on_line_overflow`](#error_on_line_overflow).
@@ -2515,7 +2515,7 @@ The layout of an array is dependent on the length of each of its elements.
2515
2515
If the length of every element in an array is below this threshold (all elements are "short") then the array can be formatted in the mixed/compressed style, but if any one element has a length that exceeds this threshold then the array elements will have to be formatted vertically.
2516
2516
2517
2517
-**Default value**: `10`
2518
-
-**Possible values**: any positive integer that is less than or equal to the value specified for [`max_width`](#max_width)
2518
+
-**Possible values**: any nonnegative integer that is less than or equal to the value specified for [`max_width`](#max_width)
2519
2519
-**Stable**: Yes
2520
2520
2521
2521
#### `10` (default):
@@ -2554,7 +2554,7 @@ Don't reformat out of line modules
2554
2554
Maximum line length for single line if-else expressions. A value of `0` (zero) results in if-else expressions always being broken into multiple lines. Note this occurs when `use_small_heuristics` is set to `Off`.
2555
2555
2556
2556
-**Default value**: `50`
2557
-
-**Possible values**: any positive integer that is less than or equal to the value specified for [`max_width`](#max_width)
2557
+
-**Possible values**: any nonnegative integer that is less than or equal to the value specified for [`max_width`](#max_width)
2558
2558
-**Stable**: Yes
2559
2559
2560
2560
By default this option is set as a percentage of [`max_width`](#max_width) provided by [`use_small_heuristics`](#use_small_heuristics), but a value set directly for `single_line_if_else_max_width` will take precedence.
@@ -2571,7 +2571,7 @@ Note this occurs when `use_small_heuristics` is set to `Off`.
2571
2571
By default this option is set as a percentage of [`max_width`](#max_width) provided by [`use_small_heuristics`](#use_small_heuristics), but a value set directly for `single_line_let_else_max_width` will take precedence.
2572
2572
2573
2573
-**Default value**: `50`
2574
-
-**Possible values**: any positive integer that is less than or equal to the value specified for [`max_width`](#max_width)
2574
+
-**Possible values**: any nonnegative integer that is less than or equal to the value specified for [`max_width`](#max_width)
2575
2575
-**Stable**: Yes
2576
2576
2577
2577
#### `50` (default):
@@ -2815,7 +2815,7 @@ See also: [`indent_style`](#indent_style).
2815
2815
Maximum width in the body of a struct literal before falling back to vertical formatting. A value of `0` (zero) results in struct literals always being broken into multiple lines. Note this occurs when `use_small_heuristics` is set to `Off`.
2816
2816
2817
2817
-**Default value**: `18`
2818
-
-**Possible values**: any positive integer that is less than or equal to the value specified for [`max_width`](#max_width)
2818
+
-**Possible values**: any nonnegative integer that is less than or equal to the value specified for [`max_width`](#max_width)
2819
2819
-**Stable**: Yes
2820
2820
2821
2821
By default this option is set as a percentage of [`max_width`](#max_width) provided by [`use_small_heuristics`](#use_small_heuristics), but a value set directly for `struct_lit_width` will take precedence.
@@ -2827,7 +2827,7 @@ See also [`max_width`](#max_width), [`use_small_heuristics`](#use_small_heuristi
2827
2827
Maximum width in the body of a struct variant before falling back to vertical formatting. A value of `0` (zero) results in struct literals always being broken into multiple lines. Note this occurs when `use_small_heuristics` is set to `Off`.
2828
2828
2829
2829
-**Default value**: `35`
2830
-
-**Possible values**: any positive integer that is less than or equal to the value specified for [`max_width`](#max_width)
2830
+
-**Possible values**: any nonnegative integer that is less than or equal to the value specified for [`max_width`](#max_width)
2831
2831
-**Stable**: Yes
2832
2832
2833
2833
By default this option is set as a percentage of [`max_width`](#max_width) provided by [`use_small_heuristics`](#use_small_heuristics), but a value set directly for `struct_variant_width` will take precedence.
@@ -2864,7 +2864,7 @@ Alternatively, you can use the `--style-edition` flag when running `rustfmt` dir
0 commit comments