@@ -1185,8 +1185,8 @@ impl clean::FnDecl {
1185
1185
cx : & Context < ' _ > ,
1186
1186
) -> fmt:: Result {
1187
1187
let amp = if f. alternate ( ) { "&" } else { "&" } ;
1188
- let mut args = String :: new ( ) ;
1189
- let mut args_plain = String :: new ( ) ;
1188
+ let mut args = Buffer :: html ( ) ;
1189
+ let mut args_plain = Buffer :: new ( ) ;
1190
1190
for ( i, input) in self . inputs . values . iter ( ) . enumerate ( ) {
1191
1191
if i == 0 {
1192
1192
args. push_str ( "<br>" ) ;
@@ -1199,59 +1199,51 @@ impl clean::FnDecl {
1199
1199
args_plain. push_str ( "self" ) ;
1200
1200
}
1201
1201
clean:: SelfBorrowed ( Some ( ref lt) , mtbl) => {
1202
- args. push_str ( & format ! (
1203
- "{}{} {}self" ,
1204
- amp,
1205
- lt. print( ) ,
1206
- mtbl. print_with_space( )
1207
- ) ) ;
1208
- args_plain. push_str ( & format ! (
1209
- "&{} {}self" ,
1210
- lt. print( ) ,
1211
- mtbl. print_with_space( )
1212
- ) ) ;
1202
+ write ! ( args, "{}{} {}self" , amp, lt. print( ) , mtbl. print_with_space( ) ) ;
1203
+ write ! ( args_plain, "&{} {}self" , lt. print( ) , mtbl. print_with_space( ) ) ;
1213
1204
}
1214
1205
clean:: SelfBorrowed ( None , mtbl) => {
1215
- args . push_str ( & format ! ( "{}{}self" , amp, mtbl. print_with_space( ) ) ) ;
1216
- args_plain . push_str ( & format ! ( "&{}self" , mtbl. print_with_space( ) ) ) ;
1206
+ write ! ( args , "{}{}self" , amp, mtbl. print_with_space( ) ) ;
1207
+ write ! ( args_plain , "&{}self" , mtbl. print_with_space( ) ) ;
1217
1208
}
1218
1209
clean:: SelfExplicit ( ref typ) => {
1219
1210
if f. alternate ( ) {
1220
- args . push_str ( & format ! ( "self: {:#}" , typ. print( cx) ) ) ;
1211
+ write ! ( args , "self: {:#}" , typ. print( cx) ) ;
1221
1212
} else {
1222
- args . push_str ( & format ! ( "self: {}" , typ. print( cx) ) ) ;
1213
+ write ! ( args , "self: {}" , typ. print( cx) ) ;
1223
1214
}
1224
- args_plain . push_str ( & format ! ( "self: {:#}" , typ. print( cx) ) ) ;
1215
+ write ! ( args_plain , "self: {:#}" , typ. print( cx) ) ;
1225
1216
}
1226
1217
}
1227
1218
} else {
1228
1219
if i > 0 {
1229
1220
args. push_str ( " <br>" ) ;
1230
- args_plain. push ( ' ' ) ;
1221
+ args_plain. push_str ( " " ) ;
1231
1222
}
1232
1223
if input. is_const {
1233
1224
args. push_str ( "const " ) ;
1234
1225
args_plain. push_str ( "const " ) ;
1235
1226
}
1236
1227
if !input. name . is_empty ( ) {
1237
- args . push_str ( & format ! ( "{}: " , input. name) ) ;
1238
- args_plain . push_str ( & format ! ( "{}: " , input. name) ) ;
1228
+ write ! ( args , "{}: " , input. name) ;
1229
+ write ! ( args_plain , "{}: " , input. name) ;
1239
1230
}
1240
1231
1241
1232
if f. alternate ( ) {
1242
- args . push_str ( & format ! ( "{:#}" , input. type_. print( cx) ) ) ;
1233
+ write ! ( args , "{:#}" , input. type_. print( cx) ) ;
1243
1234
} else {
1244
- args . push_str ( & input. type_ . print ( cx) . to_string ( ) ) ;
1235
+ write ! ( args , "{}" , input. type_. print( cx) ) ;
1245
1236
}
1246
- args_plain . push_str ( & format ! ( "{:#}" , input. type_. print( cx) ) ) ;
1237
+ write ! ( args_plain , "{:#}" , input. type_. print( cx) ) ;
1247
1238
}
1248
1239
if i + 1 < self . inputs . values . len ( ) {
1249
- args. push ( ',' ) ;
1250
- args_plain. push ( ',' ) ;
1240
+ args. push_str ( "," ) ;
1241
+ args_plain. push_str ( "," ) ;
1251
1242
}
1252
1243
}
1253
1244
1254
- let mut args_plain = format ! ( "({})" , args_plain) ;
1245
+ let mut args_plain = format ! ( "({})" , args_plain. into_inner( ) ) ;
1246
+ let mut args = args. into_inner ( ) ;
1255
1247
1256
1248
if self . c_variadic {
1257
1249
args. push_str ( ",<br> ..." ) ;
0 commit comments