rustdoc: stop treating everything in a trait item as a method
This was added in0b9b4b7068to fix the spacing on trait pages, but stopped being needed because791f04e5a4stopped styling method-toggle. By only putting the method-toggle class on actual methods, the JS setting does the right thing.
This commit is contained in:
parent
37d7de3379
commit
7e64cebf97
4 changed files with 13 additions and 3 deletions
|
|
@ -1512,8 +1512,7 @@ fn render_impl(
|
|||
|
||||
let toggled = !doc_buffer.is_empty();
|
||||
if toggled {
|
||||
let method_toggle_class =
|
||||
if item_type == ItemType::Method { " method-toggle" } else { "" };
|
||||
let method_toggle_class = if item_type.is_method() { " method-toggle" } else { "" };
|
||||
write!(w, "<details class=\"rustdoc-toggle{}\" open><summary>", method_toggle_class);
|
||||
}
|
||||
match &*item.kind {
|
||||
|
|
|
|||
|
|
@ -732,7 +732,8 @@ fn item_trait(w: &mut Buffer, cx: &mut Context<'_>, it: &clean::Item, t: &clean:
|
|||
document(&mut content, cx, m, Some(t), HeadingOffset::H5);
|
||||
let toggled = !content.is_empty();
|
||||
if toggled {
|
||||
write!(w, "<details class=\"rustdoc-toggle method-toggle\" open><summary>");
|
||||
let method_toggle_class = if item_type.is_method() { " method-toggle" } else { "" };
|
||||
write!(w, "<details class=\"rustdoc-toggle{method_toggle_class}\" open><summary>");
|
||||
}
|
||||
write!(w, "<section id=\"{}\" class=\"method has-srclink\">", id);
|
||||
render_rightside(w, cx, m, t, RenderMode::Normal);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue