@@ -1313,6 +1313,7 @@ fn render_impl(
13131313 let cache = cx. cache ( ) ;
13141314 let traits = & cache. traits ;
13151315 let trait_ = i. trait_did_full ( cache) . map ( |did| & traits[ & did] ) ;
1316+ let mut close_tags = String :: new ( ) ;
13161317
13171318 if render_mode == RenderMode :: Normal {
13181319 let id = cx. derive_id ( match i. inner_impl ( ) . trait_ {
@@ -1331,7 +1332,12 @@ fn render_impl(
13311332 format ! ( " aliases=\" {}\" " , aliases. join( "," ) )
13321333 } ;
13331334 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>" ) ;
13351341 write ! ( w, "{}" , i. inner_impl( ) . print( use_absolute, cx) ) ;
13361342 if show_def_docs {
13371343 for it in & i. inner_impl ( ) . items {
@@ -1354,11 +1360,12 @@ fn render_impl(
13541360 } else {
13551361 write ! (
13561362 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>" ,
13581364 id,
13591365 aliases,
13601366 i. inner_impl( ) . print( false , cx)
13611367 ) ;
1368+ close_tags. insert_str ( 0 , "</details>" ) ;
13621369 }
13631370 write ! ( w, "<a href=\" #{}\" class=\" anchor\" ></a>" , id) ;
13641371 render_stability_since_raw (
@@ -1370,6 +1377,7 @@ fn render_impl(
13701377 ) ;
13711378 write_srclink ( cx, & i. impl_item , w) ;
13721379 w. write_str ( "</h3>" ) ;
1380+ w. write_str ( "</summary>" ) ;
13731381
13741382 if trait_. is_some ( ) {
13751383 if let Some ( portability) = portability ( & i. impl_item , Some ( parent) ) {
@@ -1580,6 +1588,7 @@ fn render_impl(
15801588 }
15811589
15821590 w. write_str ( "<div class=\" impl-items\" >" ) ;
1591+ close_tags. insert_str ( 0 , "</div>" ) ;
15831592 for trait_item in & i. inner_impl ( ) . items {
15841593 doc_impl_item (
15851594 w,
@@ -1650,7 +1659,7 @@ fn render_impl(
16501659 ) ;
16511660 }
16521661 }
1653- w. write_str ( "</div>" ) ;
1662+ w. write_str ( & close_tags ) ;
16541663}
16551664
16561665fn print_sidebar ( cx : & Context < ' _ > , it : & clean:: Item , buffer : & mut Buffer ) {
0 commit comments