@@ -371,16 +371,21 @@ fn item_module(w: &mut Buffer, cx: &mut Context<'_>, item: &clean::Item, items:
371
371
}
372
372
clean:: ImportKind :: Glob => String :: new ( ) ,
373
373
} ;
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
+ } ;
374
380
write ! (
375
381
w,
376
382
"<div class=\" item-left {stab}{add}import-item\" {id}>\
377
383
<code>{vis}{imp}</code>\
378
384
</div>\
379
- <div class= \" item-right docblock-short \" >{ stab_tags}</div> ",
385
+ {stab_tags_before}{ stab_tags}{stab_tags_after} ",
380
386
stab = stab. unwrap_or_default( ) ,
381
387
vis = myitem. visibility. print_with_space( myitem. item_id, cx) ,
382
388
imp = import. print( cx) ,
383
- stab_tags = stab_tags. unwrap_or_default( ) ,
384
389
) ;
385
390
w. write_str ( ITEM_TABLE_ROW_CLOSE ) ;
386
391
}
@@ -412,6 +417,12 @@ fn item_module(w: &mut Buffer, cx: &mut Context<'_>, item: &clean::Item, items:
412
417
413
418
let doc_value = myitem. doc_value ( ) . unwrap_or_default ( ) ;
414
419
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
+ } ;
415
426
write ! (
416
427
w,
417
428
"<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:
420
431
{unsafety_flag}\
421
432
{stab_tags}\
422
433
</div>\
423
- <div class= \" item-right docblock-short \" >{ docs}</div> ",
434
+ {docs_before}{ docs}{docs_after} ",
424
435
name = myitem. name. unwrap( ) ,
425
436
visibility_emoji = visibility_emoji,
426
437
stab_tags = extra_info_tags( myitem, item, cx. tcx( ) ) ,
427
- docs = MarkdownSummaryLine ( & doc_value, & myitem. links( cx) ) . into_string( ) ,
428
438
class = myitem. type_( ) ,
429
439
add = add,
430
440
stab = stab. unwrap_or_default( ) ,
0 commit comments