@@ -371,16 +371,21 @@ fn item_module(w: &mut Buffer, cx: &mut Context<'_>, item: &clean::Item, items:
371371 }
372372 clean:: ImportKind :: Glob => String :: new ( ) ,
373373 } ;
374+ let stab_tags = stab_tags. unwrap_or_default ( ) ;
375+ let ( stab_tags_before, stab_tags_after) = if stab_tags. is_empty ( ) {
376+ ( "" , "" )
377+ } else {
378+ ( "<div class=\" item-right docblock-short\" >" , "</div>" )
379+ } ;
374380 write ! (
375381 w,
376382 "<div class=\" item-left {stab}{add}import-item\" {id}>\
377383 <code>{vis}{imp}</code>\
378384 </div>\
379- <div class= \" item-right docblock-short \" >{ stab_tags}</div> ",
385+ {stab_tags_before}{ stab_tags}{stab_tags_after} ",
380386 stab = stab. unwrap_or_default( ) ,
381387 vis = myitem. visibility. print_with_space( myitem. item_id, cx) ,
382388 imp = import. print( cx) ,
383- stab_tags = stab_tags. unwrap_or_default( ) ,
384389 ) ;
385390 w. write_str ( ITEM_TABLE_ROW_CLOSE ) ;
386391 }
@@ -412,6 +417,12 @@ fn item_module(w: &mut Buffer, cx: &mut Context<'_>, item: &clean::Item, items:
412417
413418 let doc_value = myitem. doc_value ( ) . unwrap_or_default ( ) ;
414419 w. write_str ( ITEM_TABLE_ROW_OPEN ) ;
420+ let docs = MarkdownSummaryLine ( & doc_value, & myitem. links ( cx) ) . into_string ( ) ;
421+ let ( docs_before, docs_after) = if docs. is_empty ( ) {
422+ ( "" , "" )
423+ } else {
424+ ( "<div class=\" item-right docblock-short\" >" , "</div>" )
425+ } ;
415426 write ! (
416427 w,
417428 "<div class=\" item-left {stab}{add}module-item\" >\
@@ -420,11 +431,10 @@ fn item_module(w: &mut Buffer, cx: &mut Context<'_>, item: &clean::Item, items:
420431 {unsafety_flag}\
421432 {stab_tags}\
422433 </div>\
423- <div class= \" item-right docblock-short \" >{ docs}</div> ",
434+ {docs_before}{ docs}{docs_after} ",
424435 name = myitem. name. unwrap( ) ,
425436 visibility_emoji = visibility_emoji,
426437 stab_tags = extra_info_tags( myitem, item, cx. tcx( ) ) ,
427- docs = MarkdownSummaryLine ( & doc_value, & myitem. links( cx) ) . into_string( ) ,
428438 class = myitem. type_( ) ,
429439 add = add,
430440 stab = stab. unwrap_or_default( ) ,
0 commit comments