Clean up document_item_info calls
This commit is contained in:
@@ -1880,10 +1880,17 @@ fn render_markdown(
|
|||||||
fn document_short(
|
fn document_short(
|
||||||
w: &mut Buffer,
|
w: &mut Buffer,
|
||||||
item: &clean::Item,
|
item: &clean::Item,
|
||||||
|
cx: &Context,
|
||||||
link: AssocItemLink<'_>,
|
link: AssocItemLink<'_>,
|
||||||
prefix: &str,
|
prefix: &str,
|
||||||
is_hidden: bool,
|
is_hidden: bool,
|
||||||
|
parent: Option<&clean::Item>,
|
||||||
|
show_def_docs: bool,
|
||||||
) {
|
) {
|
||||||
|
document_item_info(w, cx, item, is_hidden, parent);
|
||||||
|
if !show_def_docs {
|
||||||
|
return;
|
||||||
|
}
|
||||||
if let Some(s) = item.doc_value() {
|
if let Some(s) = item.doc_value() {
|
||||||
let mut summary_html = MarkdownSummaryLine(s, &item.links()).into_string();
|
let mut summary_html = MarkdownSummaryLine(s, &item.links()).into_string();
|
||||||
|
|
||||||
@@ -3806,13 +3813,22 @@ fn render_impl(
|
|||||||
if let Some(it) = t.items.iter().find(|i| i.name == item.name) {
|
if let Some(it) = t.items.iter().find(|i| i.name == item.name) {
|
||||||
// We need the stability of the item from the trait
|
// We need the stability of the item from the trait
|
||||||
// because impls can't have a stability.
|
// because impls can't have a stability.
|
||||||
document_item_info(w, cx, it, is_hidden, Some(parent));
|
|
||||||
if item.doc_value().is_some() {
|
if item.doc_value().is_some() {
|
||||||
|
document_item_info(w, cx, it, is_hidden, Some(parent));
|
||||||
document_full(w, item, cx, "", is_hidden);
|
document_full(w, item, cx, "", is_hidden);
|
||||||
} else if show_def_docs {
|
} else {
|
||||||
// In case the item isn't documented,
|
// In case the item isn't documented,
|
||||||
// provide short documentation from the trait.
|
// provide short documentation from the trait.
|
||||||
document_short(w, it, link, "", is_hidden);
|
document_short(
|
||||||
|
w,
|
||||||
|
it,
|
||||||
|
cx,
|
||||||
|
link,
|
||||||
|
"",
|
||||||
|
is_hidden,
|
||||||
|
Some(parent),
|
||||||
|
show_def_docs,
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@@ -3822,10 +3838,7 @@ fn render_impl(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
document_item_info(w, cx, item, is_hidden, Some(parent));
|
document_short(w, item, cx, link, "", is_hidden, Some(parent), show_def_docs);
|
||||||
if show_def_docs {
|
|
||||||
document_short(w, item, link, "", is_hidden);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user