File tree Expand file tree Collapse file tree 1 file changed +10
-2
lines changed
src/librustdoc/html/render Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -534,12 +534,17 @@ impl<'tcx> FormatRenderer<'tcx> for Context<'tcx> {
534534 if !root_path. ends_with ( '/' ) {
535535 root_path. push ( '/' ) ;
536536 }
537+ let description = krate
538+ . module
539+ . as_ref ( )
540+ . and_then ( |item| Some ( plain_text_summary ( item. doc_value ( ) ?. as_str ( ) ) ) )
541+ . unwrap_or_else ( || String :: from ( "List of all items in this crate" ) ) ;
537542 let mut page = layout:: Page {
538543 title : "List of all items in this crate" ,
539544 css_class : "mod" ,
540545 root_path : "../" ,
541546 static_root_path : self . shared . static_root_path . as_deref ( ) ,
542- description : "List of all items in this crate" ,
547+ description : description . as_str ( ) ,
543548 keywords : BASIC_KEYWORDS ,
544549 resource_suffix : & self . shared . resource_suffix ,
545550 extra_scripts : & [ ] ,
@@ -1548,7 +1553,10 @@ impl Context<'_> {
15481553 }
15491554 title. push_str ( " - Rust" ) ;
15501555 let tyname = it. type_ ( ) ;
1551- let desc = if it. is_crate ( ) {
1556+ let desc = it. doc_value ( ) . as_ref ( ) . map ( |doc| plain_text_summary ( & doc) ) ;
1557+ let desc = if let Some ( desc) = desc {
1558+ desc
1559+ } else if it. is_crate ( ) {
15521560 format ! ( "API documentation for the Rust `{}` crate." , self . shared. layout. krate)
15531561 } else {
15541562 format ! (
You can’t perform that action at this time.
0 commit comments