@@ -2584,24 +2584,39 @@ fn item_module(w: &mut fmt::Formatter, cx: &Context,
25842584 _ => "" ,
25852585 } ;
25862586
2587+ let stab = myitem. stability_class ( ) ;
2588+ let add = if stab. is_some ( ) {
2589+ " "
2590+ } else {
2591+ ""
2592+ } ;
2593+
25872594 let doc_value = myitem. doc_value ( ) . unwrap_or ( "" ) ;
2588- write ! ( w, "
2589- <tr class='{stab} module-item'>
2590- <td><a class=\" {class}\" href=\" {href}\"
2591- title='{title_type} {title}'>{name}</a>{unsafety_flag}</td>
2592- <td class='docblock-short'>
2593- {stab_docs} {docs}
2594- </td>
2595+ write ! ( w, "\
2596+ <tr class='{stab}{add}module-item'>\
2597+ <td><a class=\" {class}\" href=\" {href}\" \
2598+ title='{title}'>{name}</a>{unsafety_flag}</td>\
2599+ <td class='docblock-short'>{stab_docs}{docs}\
2600+ </td>\
25952601 </tr>",
25962602 name = * myitem. name. as_ref( ) . unwrap( ) ,
25972603 stab_docs = stab_docs,
25982604 docs = MarkdownSummaryLine ( doc_value, & myitem. links( ) ) ,
25992605 class = myitem. type_( ) ,
2600- stab = myitem. stability_class( ) . unwrap_or( String :: new( ) ) ,
2606+ add = add,
2607+ stab = stab. unwrap_or_else( || String :: new( ) ) ,
26012608 unsafety_flag = unsafety_flag,
26022609 href = item_path( myitem. type_( ) , myitem. name. as_ref( ) . unwrap( ) ) ,
2603- title_type = myitem. type_( ) ,
2604- title = full_path( cx, myitem) ) ?;
2610+ title = [ full_path( cx, myitem) , myitem. type_( ) . to_string( ) ]
2611+ . iter( )
2612+ . filter_map( |s| if !s. is_empty( ) {
2613+ Some ( s. as_str( ) )
2614+ } else {
2615+ None
2616+ } )
2617+ . collect:: <Vec <_>>( )
2618+ . join( " " ) ,
2619+ ) ?;
26052620 }
26062621 }
26072622 }
0 commit comments