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