File tree 1 file changed +10
-2
lines changed
src/librustdoc/html/render
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> {
534
534
if !root_path. ends_with ( '/' ) {
535
535
root_path. push ( '/' ) ;
536
536
}
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" ) ) ;
537
542
let mut page = layout:: Page {
538
543
title : "List of all items in this crate" ,
539
544
css_class : "mod" ,
540
545
root_path : "../" ,
541
546
static_root_path : self . shared . static_root_path . as_deref ( ) ,
542
- description : "List of all items in this crate" ,
547
+ description : description . as_str ( ) ,
543
548
keywords : BASIC_KEYWORDS ,
544
549
resource_suffix : & self . shared . resource_suffix ,
545
550
extra_scripts : & [ ] ,
@@ -1548,7 +1553,10 @@ impl Context<'_> {
1548
1553
}
1549
1554
title. push_str ( " - Rust" ) ;
1550
1555
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 ( ) {
1552
1560
format ! ( "API documentation for the Rust `{}` crate." , self . shared. layout. krate)
1553
1561
} else {
1554
1562
format ! (
You can’t perform that action at this time.
0 commit comments