File tree 1 file changed +6
-5
lines changed
1 file changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -222,15 +222,16 @@ impl clean::Generics {
222
222
cx : & ' a Context < ' tcx > ,
223
223
) -> impl fmt:: Display + ' a + Captures < ' tcx > {
224
224
display_fn ( move |f| {
225
- let real_params =
226
- self . params . iter ( ) . filter ( |p| !p. is_synthetic_type_param ( ) ) . collect :: < Vec < _ > > ( ) ;
227
- if real_params. is_empty ( ) {
225
+ let mut real_params =
226
+ self . params . iter ( ) . filter ( |p| !p. is_synthetic_type_param ( ) ) . peekable ( ) ;
227
+ if real_params. peek ( ) . is_none ( ) {
228
228
return Ok ( ( ) ) ;
229
229
}
230
+
230
231
if f. alternate ( ) {
231
- write ! ( f, "<{:#}>" , comma_sep( real_params. iter ( ) . map( |g| g. print( cx) ) ) )
232
+ write ! ( f, "<{:#}>" , comma_sep( real_params. map( |g| g. print( cx) ) ) )
232
233
} else {
233
- write ! ( f, "<{}>" , comma_sep( real_params. iter ( ) . map( |g| g. print( cx) ) ) )
234
+ write ! ( f, "<{}>" , comma_sep( real_params. map( |g| g. print( cx) ) ) )
234
235
}
235
236
} )
236
237
}
You can’t perform that action at this time.
0 commit comments