@@ -1321,23 +1321,22 @@ impl AllTypes {
1321
1321
}
1322
1322
}
1323
1323
1324
- fn print_entries ( f : & mut Buffer , e : & FxHashSet < ItemEntry > , title : & str , class : & str ) {
1325
- if !e. is_empty ( ) {
1326
- let mut e: Vec < & ItemEntry > = e. iter ( ) . collect ( ) ;
1327
- e. sort ( ) ;
1328
- write ! (
1329
- f,
1330
- "<h3 id=\" {}\" >{}</h3><ul class=\" {} docblock\" >{}</ul>" ,
1331
- title,
1332
- Escape ( title) ,
1333
- class,
1334
- e. iter( ) . map( |s| format!( "<li>{}</li>" , s. print( ) ) ) . collect:: <String >( )
1335
- ) ;
1336
- }
1337
- }
1338
-
1339
1324
impl AllTypes {
1340
1325
fn print ( self , f : & mut Buffer ) {
1326
+ fn print_entries ( f : & mut Buffer , e : & FxHashSet < ItemEntry > , title : & str , class : & str ) {
1327
+ if !e. is_empty ( ) {
1328
+ let mut e: Vec < & ItemEntry > = e. iter ( ) . collect ( ) ;
1329
+ e. sort ( ) ;
1330
+ write ! ( f, "<h3 id=\" {}\" >{}</h3><ul class=\" {} docblock\" >" , title, title, class) ;
1331
+
1332
+ for s in e. iter ( ) {
1333
+ write ! ( f, "<li>{}</li>" , s. print( ) ) ;
1334
+ }
1335
+
1336
+ write ! ( f, "</ul>" ) ;
1337
+ }
1338
+ }
1339
+
1341
1340
write ! (
1342
1341
f,
1343
1342
"<h1 class=\" fqn\" >\
@@ -1352,6 +1351,8 @@ impl AllTypes {
1352
1351
</span>
1353
1352
</h1>"
1354
1353
) ;
1354
+ // Note: print_entries does not escape the title, because we know the current set of titles
1355
+ // don't require escaping.
1355
1356
print_entries ( f, & self . structs , "Structs" , "structs" ) ;
1356
1357
print_entries ( f, & self . enums , "Enums" , "enums" ) ;
1357
1358
print_entries ( f, & self . unions , "Unions" , "unions" ) ;
0 commit comments