File tree Expand file tree Collapse file tree 1 file changed +15
-6
lines changed
src/librustdoc/html/render Expand file tree Collapse file tree 1 file changed +15
-6
lines changed Original file line number Diff line number Diff line change @@ -567,18 +567,27 @@ fn document_short<'a, 'cx: 'a>(
567567 let ( mut summary_html, has_more_content) =
568568 MarkdownSummaryLine ( & s, & item. links ( cx) ) . into_string_with_has_more_content ( ) ;
569569
570- if has_more_content {
571- let link =
572- format ! ( " <a{}>Read more</a>" , assoc_href_attr( item, link, cx) . maybe_display( ) ) ;
570+ let link = if has_more_content {
571+ let link = fmt:: from_fn ( |f| {
572+ write ! (
573+ f,
574+ " <a{}>Read more</a>" ,
575+ assoc_href_attr( item, link, cx) . maybe_display( )
576+ )
577+ } ) ;
573578
574579 if let Some ( idx) = summary_html. rfind ( "</p>" ) {
575- summary_html. insert_str ( idx, & link) ;
580+ summary_html. insert_str ( idx, & link. to_string ( ) ) ;
581+ None
576582 } else {
577- summary_html . push_str ( & link) ;
583+ Some ( link)
578584 }
585+ } else {
586+ None
579587 }
588+ . maybe_display ( ) ;
580589
581- write ! ( f, "<div class='docblock'>{summary_html}</div>" ) ?;
590+ write ! ( f, "<div class='docblock'>{summary_html}{link} </div>" ) ?;
582591 }
583592 Ok ( ( ) )
584593 } )
You can’t perform that action at this time.
0 commit comments