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 @@ -569,18 +569,27 @@ fn document_short<'a, 'cx: 'a>(
569569 let ( mut summary_html, has_more_content) =
570570 MarkdownSummaryLine ( & s, & item. links ( cx) ) . into_string_with_has_more_content ( ) ;
571571
572- if has_more_content {
573- let link =
574- format ! ( " <a{}>Read more</a>" , assoc_href_attr( item, link, cx) . maybe_display( ) ) ;
572+ let link = if has_more_content {
573+ let link = fmt:: from_fn ( |f| {
574+ write ! (
575+ f,
576+ " <a{}>Read more</a>" ,
577+ assoc_href_attr( item, link, cx) . maybe_display( )
578+ )
579+ } ) ;
575580
576581 if let Some ( idx) = summary_html. rfind ( "</p>" ) {
577- summary_html. insert_str ( idx, & link) ;
582+ summary_html. insert_str ( idx, & link. to_string ( ) ) ;
583+ None
578584 } else {
579- summary_html . push_str ( & link) ;
585+ Some ( link)
580586 }
587+ } else {
588+ None
581589 }
590+ . maybe_display ( ) ;
582591
583- write ! ( f, "<div class='docblock'>{summary_html}</div>" ) ?;
592+ write ! ( f, "<div class='docblock'>{summary_html}{link} </div>" ) ?;
584593 }
585594 Ok ( ( ) )
586595 } )
You can’t perform that action at this time.
0 commit comments