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
+37-1
Original file line number
Diff line number
Diff line change
@@ -1862,6 +1862,42 @@ fn foo() {
1862
1862
}
1863
1863
```
1864
1864
1865
+
## `match_arm_indent`
1866
+
1867
+
Controls whether match arms are indented. If disabled, the match patterns will be located on the indentation level as the match statement itself. This means match blocks will only be indented once, not twice.
1868
+
1869
+
-**Default value**: `true`
1870
+
-**Possible values**: `true`, `false`
1871
+
-**Stable**: No (TODO tracking issue)
1872
+
1873
+
#### `true` (default):
1874
+
1875
+
```rust
1876
+
fnmain() {
1877
+
matchvalue {
1878
+
Enum::A=> {
1879
+
letmutwork=first();
1880
+
work+=second();
1881
+
}
1882
+
Enum::B=>short_work(),
1883
+
}
1884
+
}
1885
+
```
1886
+
1887
+
#### `false`:
1888
+
1889
+
```rust
1890
+
fnmain() {
1891
+
matchvalue {
1892
+
Enum::A=> {
1893
+
letmutwork=first();
1894
+
work+=second();
1895
+
}
1896
+
Enum::B=>short_work(),
1897
+
}
1898
+
}
1899
+
```
1900
+
1865
1901
## `match_block_trailing_comma`
1866
1902
1867
1903
Put a trailing comma after a block based match arm (non-block arms are not affected)
The width threshold for an array element to be considered "short".
2477
2513
2478
-
The layout of an array is dependent on the length of each of its elements.
2514
+
The layout of an array is dependent on the length of each of its elements.
2479
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.
0 commit comments