@@ -25,22 +25,26 @@ impl<'a> FmtVisitor<'a> {
25
25
..} ) => {
26
26
if bound_lifetimes. len ( ) > 0 {
27
27
format ! ( "for<{}> {}: {}" ,
28
- bound_lifetimes. iter( ) . map( |l| self . rewrite_lifetime_def( l) ) . collect:: <Vec <_>>( ) . connect( ", " ) ,
28
+ bound_lifetimes. iter( ) . map( |l| self . rewrite_lifetime_def( l) )
29
+ . collect:: <Vec <_>>( ) . connect( ", " ) ,
29
30
pprust:: ty_to_string( bounded_ty) ,
30
- bounds. iter( ) . map( |b| self . rewrite_ty_bound( b) ) . collect:: <Vec <_>>( ) . connect( " + " ) )
31
+ bounds. iter( ) . map( |b| self . rewrite_ty_bound( b) )
32
+ . collect:: <Vec <_>>( ) . connect( " + " ) )
31
33
32
34
} else {
33
35
format ! ( "{}: {}" ,
34
36
pprust:: ty_to_string( bounded_ty) ,
35
- bounds. iter( ) . map( |b| self . rewrite_ty_bound( b) ) . collect:: <Vec <_>>( ) . connect( " + " ) )
37
+ bounds. iter( ) . map( |b| self . rewrite_ty_bound( b) )
38
+ . collect:: <Vec <_>>( ) . connect( " + " ) )
36
39
}
37
40
}
38
41
& ast:: WherePredicate :: RegionPredicate ( ast:: WhereRegionPredicate { ref lifetime,
39
42
ref bounds,
40
43
..} ) => {
41
44
format ! ( "{}: {}" ,
42
45
pprust:: lifetime_to_string( lifetime) ,
43
- bounds. iter( ) . map( |l| pprust:: lifetime_to_string( l) ) . collect:: <Vec <_>>( ) . connect( " + " ) )
46
+ bounds. iter( ) . map( |l| pprust:: lifetime_to_string( l) )
47
+ . collect:: <Vec <_>>( ) . connect( " + " ) )
44
48
}
45
49
& ast:: WherePredicate :: EqPredicate ( ast:: WhereEqPredicate { ref path, ref ty, ..} ) => {
46
50
format ! ( "{} = {}" , pprust:: path_to_string( path) , pprust:: ty_to_string( ty) )
@@ -55,7 +59,8 @@ impl<'a> FmtVisitor<'a> {
55
59
56
60
format ! ( "{}: {}" ,
57
61
pprust:: lifetime_to_string( & lifetime. lifetime) ,
58
- lifetime. bounds. iter( ) . map( |l| pprust:: lifetime_to_string( l) ) . collect:: <Vec <_>>( ) . connect( " + " ) )
62
+ lifetime. bounds. iter( ) . map( |l| pprust:: lifetime_to_string( l) )
63
+ . collect:: <Vec <_>>( ) . connect( " + " ) )
59
64
}
60
65
61
66
pub fn rewrite_ty_bound ( & self , bound : & ast:: TyParamBound ) -> String {
@@ -77,7 +82,8 @@ impl<'a> FmtVisitor<'a> {
77
82
result. push_str ( & token:: get_ident ( ty_param. ident ) ) ;
78
83
if ty_param. bounds . len ( ) > 0 {
79
84
result. push_str ( ": " ) ;
80
- result. push_str ( & ty_param. bounds . iter ( ) . map ( |b| self . rewrite_ty_bound ( b) ) . collect :: < Vec < _ > > ( ) . connect ( " + " ) ) ;
85
+ result. push_str ( & ty_param. bounds . iter ( ) . map ( |b| self . rewrite_ty_bound ( b) )
86
+ . collect :: < Vec < _ > > ( ) . connect ( " + " ) ) ;
81
87
}
82
88
if let Some ( ref def) = ty_param. default {
83
89
result. push_str ( " = " ) ;
@@ -90,7 +96,8 @@ impl<'a> FmtVisitor<'a> {
90
96
fn rewrite_poly_trait_ref ( & self , t : & ast:: PolyTraitRef ) -> String {
91
97
if t. bound_lifetimes . len ( ) > 0 {
92
98
format ! ( "for<{}> {}" ,
93
- t. bound_lifetimes. iter( ) . map( |l| self . rewrite_lifetime_def( l) ) . collect:: <Vec <_>>( ) . connect( ", " ) ,
99
+ t. bound_lifetimes. iter( ) . map( |l| self . rewrite_lifetime_def( l) )
100
+ . collect:: <Vec <_>>( ) . connect( ", " ) ,
94
101
pprust:: path_to_string( & t. trait_ref. path) )
95
102
96
103
} else {
0 commit comments