@@ -1313,6 +1313,7 @@ fn render_impl(
1313
1313
let cache = cx. cache ( ) ;
1314
1314
let traits = & cache. traits ;
1315
1315
let trait_ = i. trait_did_full ( cache) . map ( |did| & traits[ & did] ) ;
1316
+ let mut close_tags = String :: new ( ) ;
1316
1317
1317
1318
if render_mode == RenderMode :: Normal {
1318
1319
let id = cx. derive_id ( match i. inner_impl ( ) . trait_ {
@@ -1331,7 +1332,12 @@ fn render_impl(
1331
1332
format ! ( " aliases=\" {}\" " , aliases. join( "," ) )
1332
1333
} ;
1333
1334
if let Some ( use_absolute) = use_absolute {
1334
- write ! ( w, "<h3 id=\" {}\" class=\" impl\" {}><code class=\" in-band\" >" , id, aliases) ;
1335
+ write ! (
1336
+ w,
1337
+ "<details class=\" rustdoc-toggle implementors-toggle\" ><summary><h3 id=\" {}\" class=\" impl\" {}><code class=\" in-band\" >" ,
1338
+ id, aliases
1339
+ ) ;
1340
+ close_tags. insert_str ( 0 , "</details>" ) ;
1335
1341
write ! ( w, "{}" , i. inner_impl( ) . print( use_absolute, cx) ) ;
1336
1342
if show_def_docs {
1337
1343
for it in & i. inner_impl ( ) . items {
@@ -1354,11 +1360,12 @@ fn render_impl(
1354
1360
} else {
1355
1361
write ! (
1356
1362
w,
1357
- "<h3 id=\" {}\" class=\" impl\" {}><code class=\" in-band\" >{}</code>" ,
1363
+ "<details class= \" rustdoc-toggle implementors-toggle \" ><summary>< h3 id=\" {}\" class=\" impl\" {}><code class=\" in-band\" >{}</code>" ,
1358
1364
id,
1359
1365
aliases,
1360
1366
i. inner_impl( ) . print( false , cx)
1361
1367
) ;
1368
+ close_tags. insert_str ( 0 , "</details>" ) ;
1362
1369
}
1363
1370
write ! ( w, "<a href=\" #{}\" class=\" anchor\" ></a>" , id) ;
1364
1371
render_stability_since_raw (
@@ -1370,6 +1377,7 @@ fn render_impl(
1370
1377
) ;
1371
1378
write_srclink ( cx, & i. impl_item , w) ;
1372
1379
w. write_str ( "</h3>" ) ;
1380
+ w. write_str ( "</summary>" ) ;
1373
1381
1374
1382
if trait_. is_some ( ) {
1375
1383
if let Some ( portability) = portability ( & i. impl_item , Some ( parent) ) {
@@ -1580,6 +1588,7 @@ fn render_impl(
1580
1588
}
1581
1589
1582
1590
w. write_str ( "<div class=\" impl-items\" >" ) ;
1591
+ close_tags. insert_str ( 0 , "</div>" ) ;
1583
1592
for trait_item in & i. inner_impl ( ) . items {
1584
1593
doc_impl_item (
1585
1594
w,
@@ -1650,7 +1659,7 @@ fn render_impl(
1650
1659
) ;
1651
1660
}
1652
1661
}
1653
- w. write_str ( "</div>" ) ;
1662
+ w. write_str ( & close_tags ) ;
1654
1663
}
1655
1664
1656
1665
fn print_sidebar ( cx : & Context < ' _ > , it : & clean:: Item , buffer : & mut Buffer ) {
0 commit comments