@@ -509,7 +509,7 @@ fn document(w: &mut Buffer, cx: &Context<'_>, item: &clean::Item, parent: Option
509
509
info ! ( "Documenting {}" , name) ;
510
510
}
511
511
document_item_info ( w, cx, item, false , parent) ;
512
- document_full ( w, item, cx, "" , false ) ;
512
+ document_full ( w, item, cx, false ) ;
513
513
}
514
514
515
515
/// Render md_text as markdown.
@@ -518,15 +518,13 @@ fn render_markdown(
518
518
cx : & Context < ' _ > ,
519
519
md_text : & str ,
520
520
links : Vec < RenderedLink > ,
521
- prefix : & str ,
522
521
is_hidden : bool ,
523
522
) {
524
523
let mut ids = cx. id_map . borrow_mut ( ) ;
525
524
write ! (
526
525
w,
527
- "<div class=\" docblock{}\" >{}{} </div>" ,
526
+ "<div class=\" docblock{}\" >{}</div>" ,
528
527
if is_hidden { " hidden" } else { "" } ,
529
- prefix,
530
528
Markdown (
531
529
md_text,
532
530
& links,
@@ -546,12 +544,11 @@ fn document_short(
546
544
item : & clean:: Item ,
547
545
cx : & Context < ' _ > ,
548
546
link : AssocItemLink < ' _ > ,
549
- prefix : & str ,
550
547
is_hidden : bool ,
551
- parent : Option < & clean:: Item > ,
548
+ parent : & clean:: Item ,
552
549
show_def_docs : bool ,
553
550
) {
554
- document_item_info ( w, cx, item, is_hidden, parent) ;
551
+ document_item_info ( w, cx, item, is_hidden, Some ( parent) ) ;
555
552
if !show_def_docs {
556
553
return ;
557
554
}
@@ -570,39 +567,17 @@ fn document_short(
570
567
571
568
write ! (
572
569
w,
573
- "<div class='docblock{}'>{}{} </div>" ,
570
+ "<div class='docblock{}'>{}</div>" ,
574
571
if is_hidden { " hidden" } else { "" } ,
575
- prefix,
576
572
summary_html,
577
573
) ;
578
- } else if !prefix. is_empty ( ) {
579
- write ! (
580
- w,
581
- "<div class=\" docblock{}\" >{}</div>" ,
582
- if is_hidden { " hidden" } else { "" } ,
583
- prefix
584
- ) ;
585
574
}
586
575
}
587
576
588
- fn document_full (
589
- w : & mut Buffer ,
590
- item : & clean:: Item ,
591
- cx : & Context < ' _ > ,
592
- prefix : & str ,
593
- is_hidden : bool ,
594
- ) {
577
+ fn document_full ( w : & mut Buffer , item : & clean:: Item , cx : & Context < ' _ > , is_hidden : bool ) {
595
578
if let Some ( s) = cx. shared . maybe_collapsed_doc_value ( item) {
596
579
debug ! ( "Doc block: =====\n {}\n =====" , s) ;
597
- render_markdown ( w, cx, & * s, item. links ( cx) , prefix, is_hidden) ;
598
- } else if !prefix. is_empty ( ) {
599
- if is_hidden {
600
- w. write_str ( "<div class=\" docblock hidden\" >" ) ;
601
- } else {
602
- w. write_str ( "<div class=\" docblock\" >" ) ;
603
- }
604
- w. write_str ( prefix) ;
605
- w. write_str ( "</div>" ) ;
580
+ render_markdown ( w, cx, & s, item. links ( cx) , is_hidden) ;
606
581
}
607
582
}
608
583
@@ -1547,30 +1522,21 @@ fn render_impl(
1547
1522
// because impls can't have a stability.
1548
1523
if item. doc_value ( ) . is_some ( ) {
1549
1524
document_item_info ( w, cx, it, is_hidden, Some ( parent) ) ;
1550
- document_full ( w, item, cx, "" , is_hidden) ;
1525
+ document_full ( w, item, cx, is_hidden) ;
1551
1526
} else {
1552
1527
// In case the item isn't documented,
1553
1528
// provide short documentation from the trait.
1554
- document_short (
1555
- w,
1556
- it,
1557
- cx,
1558
- link,
1559
- "" ,
1560
- is_hidden,
1561
- Some ( parent) ,
1562
- show_def_docs,
1563
- ) ;
1529
+ document_short ( w, it, cx, link, is_hidden, parent, show_def_docs) ;
1564
1530
}
1565
1531
}
1566
1532
} else {
1567
1533
document_item_info ( w, cx, item, is_hidden, Some ( parent) ) ;
1568
1534
if show_def_docs {
1569
- document_full ( w, item, cx, "" , is_hidden) ;
1535
+ document_full ( w, item, cx, is_hidden) ;
1570
1536
}
1571
1537
}
1572
1538
} else {
1573
- document_short ( w, item, cx, link, "" , is_hidden, Some ( parent) , show_def_docs) ;
1539
+ document_short ( w, item, cx, link, is_hidden, parent, show_def_docs) ;
1574
1540
}
1575
1541
}
1576
1542
}
0 commit comments