@@ -41,10 +41,13 @@ let a = vec![
41
41
```
42
42
43
43
#### ` 1000 ` :
44
+
44
45
``` rust
45
46
// 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 ];
47
+ let a = vec! [
48
+ 0 , 1 , 2 , 3 , 4 , ...
49
+ ... , 999 , 1000 ,
50
+ ];
48
51
```
49
52
50
53
## ` array_layout `
@@ -91,8 +94,7 @@ Maximum width of an array literal before falling back to vertical formatting
91
94
92
95
#### Lines shorter than ` array_width ` :
93
96
``` rust
94
- let lorem =
95
- vec! [" ipsum" , " dolor" , " sit" , " amet" , " consectetur" , " adipiscing" , " elit" ];
97
+ let lorem = vec! [" ipsum" , " dolor" , " sit" , " amet" , " consectetur" , " adipiscing" , " elit" ];
96
98
```
97
99
98
100
#### Lines longer than ` array_width ` :
@@ -199,6 +201,8 @@ lorem_ipsum(|| {
199
201
});
200
202
```
201
203
204
+ ** Note** : This option only takes effect when ` fn_call_style ` is set to ` "Visual" ` .
205
+
202
206
## ` combine_control_expr `
203
207
204
208
Combine control expressions with function calls.
@@ -400,11 +404,15 @@ trait Lorem {
400
404
// body
401
405
}
402
406
403
- fn lorem (ipsum : Ipsum , dolor : Dolor , sit : Sit , amet : Amet , consectetur : Consectetur ,
404
- adipiscing : Adipiscing , elit : Elit );
407
+ fn lorem (
408
+ ipsum : Ipsum , dolor : Dolor , sit : Sit , amet : Amet , consectetur : Consectetur ,
409
+ adipiscing : Adipiscing , elit : Elit ,
410
+ );
405
411
406
- fn lorem (ipsum : Ipsum , dolor : Dolor , sit : Sit , amet : Amet , consectetur : Consectetur ,
407
- adipiscing : Adipiscing , elit : Elit ) {
412
+ fn lorem (
413
+ ipsum : Ipsum , dolor : Dolor , sit : Sit , amet : Amet , consectetur : Consectetur ,
414
+ adipiscing : Adipiscing , elit : Elit ,
415
+ ) {
408
416
// body
409
417
}
410
418
}
@@ -420,16 +428,20 @@ trait Lorem {
420
428
// body
421
429
}
422
430
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 ) {
431
+ fn lorem (
432
+ ipsum : Ipsum , dolor : Dolor , sit : Sit , amet : Amet , consectetur : Consectetur ,
433
+ adipiscing : Adipiscing , elit : Elit ,
434
+ );
435
+
436
+ fn lorem (
437
+ ipsum : Ipsum ,
438
+ dolor : Dolor ,
439
+ sit : Sit ,
440
+ amet : Amet ,
441
+ consectetur : onsectetur ,
442
+ adipiscing : Adipiscing ,
443
+ elit : Elit ,
444
+ ) {
433
445
// body
434
446
}
435
447
}
@@ -445,21 +457,25 @@ trait Lorem {
445
457
// body
446
458
}
447
459
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 ) {
460
+ fn lorem (
461
+ ipsum : Ipsum ,
462
+ dolor : Dolor ,
463
+ sit : Sit ,
464
+ amet : Amet ,
465
+ consectetur : onsectetur ,
466
+ adipiscing : Adipiscing ,
467
+ elit : Elit ,
468
+ );
469
+
470
+ fn lorem (
471
+ ipsum : Ipsum ,
472
+ dolor : Dolor ,
473
+ sit : Sit ,
474
+ amet : Amet ,
475
+ consectetur : onsectetur ,
476
+ adipiscing : Adipiscing ,
477
+ elit : Elit ,
478
+ ) {
463
479
// body
464
480
}
465
481
}
@@ -560,8 +576,8 @@ fn lorem(
560
576
ipsum : Ipsum ,
561
577
dolor : Dolor ,
562
578
sit : Sit ,
563
- amet : Amet )
564
- -> DolorSitAmetConsecteturAdipiscingElitLoremIpsumDolorSitAmetConsecteturAdipiscingElit {
579
+ amet : Amet ,
580
+ ) -> DolorSitAmetConsecteturAdipiscingElitLoremIpsumDolorSitAmetConsecteturAdipiscingElit {
565
581
// body
566
582
}
567
583
```
@@ -570,11 +586,12 @@ fn lorem(
570
586
571
587
``` rust
572
588
fn lorem
573
- (ipsum : Ipsum ,
574
- dolor : Dolor ,
575
- sit : Sit ,
576
- amet : Amet )
577
- -> DolorSitAmetConsecteturAdipiscingElitLoremIpsumDolorSitAmetConsecteturAdipiscingElit {
589
+ (
590
+ ipsum : Ipsum ,
591
+ dolor : Dolor ,
592
+ sit : Sit ,
593
+ amet : Amet ,
594
+ ) -> DolorSitAmetConsecteturAdipiscingElitLoremIpsumDolorSitAmetConsecteturAdipiscingElit {
578
595
// body
579
596
}
580
597
```
@@ -600,7 +617,8 @@ fn lorem(ipsum: usize)
600
617
}
601
618
602
619
fn lorem <T >(ipsum : T )
603
- where T : Add + Sub + Mul + Div
620
+ where
621
+ T : Add + Sub + Mul + Div ,
604
622
{
605
623
// body
606
624
}
@@ -618,7 +636,8 @@ fn lorem(ipsum: usize) {
618
636
}
619
637
620
638
fn lorem <T >(ipsum : T )
621
- where T : Add + Sub + Mul + Div {
639
+ where
640
+ T : Add + Sub + Mul + Div , {
622
641
// body
623
642
}
624
643
```
@@ -635,7 +654,8 @@ fn lorem(ipsum: usize) {
635
654
}
636
655
637
656
fn lorem <T >(ipsum : T )
638
- where T : Add + Sub + Mul + Div
657
+ where
658
+ T : Add + Sub + Mul + Div ,
639
659
{
640
660
// body
641
661
}
@@ -757,6 +777,8 @@ fn lorem(ipsum: Ipsum,
757
777
758
778
```
759
779
780
+ ** Note** : This option only takes effect when ` fn_call_style ` is set to ` "Visual" ` .
781
+
760
782
## ` fn_single_line `
761
783
762
784
Put single-expression functions on a single line
@@ -867,14 +889,15 @@ fn lorem<
867
889
Adipiscing : Eq = usize ,
868
890
Consectetur : Eq = usize ,
869
891
Elit : Eq = usize
870
- >(ipsum : Ipsum ,
892
+ >(
893
+ ipsum : Ipsum ,
871
894
dolor : Dolor ,
872
895
sit : Sit ,
873
896
amet : Amet ,
874
897
adipiscing : Adipiscing ,
875
898
consectetur : Consectetur ,
876
- elit : Elit )
877
- -> T {
899
+ elit : Elit ,
900
+ ) -> T {
878
901
// body
879
902
}
880
903
```
@@ -1844,7 +1867,7 @@ let lorem = ipsum.map(|dolor| dolor.sit())?;
1844
1867
1845
1868
## ` where_density `
1846
1869
1847
- Density of a where clause
1870
+ Density of a where clause.
1848
1871
1849
1872
- ** Default value** : ` "CompressedIfEmpty" `
1850
1873
- ** Possible values** : ` "Compressed" ` , ` "CompressedIfEmpty" ` , ` "Tall" ` , ` "Vertical" `
@@ -1853,9 +1876,11 @@ Density of a where clause
1853
1876
1854
1877
``` rust
1855
1878
trait Lorem {
1856
- fn ipsum <Dolor >(dolor : Dolor ) -> Sit where Dolor : Eq ;
1879
+ fn ipsum <Dolor >(dolor : Dolor ) -> Sit
1880
+ where Dolor : Eq ;
1857
1881
1858
- fn ipsum <Dolor >(dolor : Dolor ) -> Sit where Dolor : Eq {
1882
+ fn ipsum <Dolor >(dolor : Dolor ) -> Sit
1883
+ where Dolor : Eq {
1859
1884
// body
1860
1885
}
1861
1886
}
@@ -1865,10 +1890,12 @@ trait Lorem {
1865
1890
1866
1891
``` rust
1867
1892
trait Lorem {
1868
- fn ipsum <Dolor >(dolor : Dolor ) -> Sit where Dolor : Eq ;
1893
+ fn ipsum <Dolor >(dolor : Dolor ) -> Sit
1894
+ where Dolor : Eq ;
1869
1895
1870
1896
fn ipsum <Dolor >(dolor : Dolor ) -> Sit
1871
- where Dolor : Eq
1897
+ where
1898
+ Dolor : Eq ,
1872
1899
{
1873
1900
// body
1874
1901
}
@@ -1880,10 +1907,12 @@ trait Lorem {
1880
1907
``` rust
1881
1908
trait Lorem {
1882
1909
fn ipsum <Dolor >(dolor : Dolor ) -> Sit
1883
- where Dolor : Eq ;
1910
+ where
1911
+ Dolor : Eq ;
1884
1912
1885
1913
fn ipsum <Dolor >(dolor : Dolor ) -> Sit
1886
- where Dolor : Eq
1914
+ where
1915
+ Dolor : Eq ,
1887
1916
{
1888
1917
// body
1889
1918
}
@@ -1990,6 +2019,8 @@ fn lorem<Ipsum, Dolor, Sit, Amet>(ipsum: Ipsum, dolor: Dolor, sit: Sit, amet: Am
1990
2019
}
1991
2020
```
1992
2021
2022
+ ** Note** : This option only takes effect when ` where_style ` is set to ` "Legacy" ` .
2023
+
1993
2024
See also: [ ` where_density ` ] ( #where_density ) , [ ` where_pred_indent ` ] ( #where_pred_indent ) , [ ` where_style ` ] ( #where_style ) .
1994
2025
1995
2026
## ` where_pred_indent `
@@ -2025,6 +2056,8 @@ fn lorem<Ipsum, Dolor, Sit, Amet>() -> T
2025
2056
}
2026
2057
```
2027
2058
2059
+ ** Note** : This option only takes effect when ` where_style ` is set to ` "Legacy" ` .
2060
+
2028
2061
See also: [ ` where_density ` ] ( #where_density ) , [ ` where_layout ` ] ( #where_layout ) , [ ` where_style ` ] ( #where_style ) .
2029
2062
2030
2063
## ` where_style `
0 commit comments