Skip to content

Commit

Permalink
Rollup merge of rust-lang#59534 - laurmaedje:collapse-blanket-impls, …
Browse files Browse the repository at this point in the history
…r=GuillaumeGomez

rustdoc: collapse blanket impls in the same way as normal impls

If the rustdoc setting _Auto-hide trait implementations documentation_ is activated (on by default), normal trait implementations are collapsed by default.

Blanket impls on the other hand are not collapsed. I'm not sure whether this is intended, but considering that the blanket impls for `From`, `Into`, `TryFrom`, ... are on every type, it would reduce the documentation bloat if these would also be collapsed when the setting is active.

(I'm not really familiar with the codebase and therefore just copied the code for the normal impl collapsing, but I could deduplicate it into a method, of course, too.)
  • Loading branch information
Centril authored Mar 30, 2019
2 parents 931151f + 9e4ec7a commit ca14c56
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/librustdoc/html/static/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -2071,6 +2071,14 @@ if (!DOMTokenList.prototype.remove) {
collapser(e, collapse);
});
}

var blanket_list = document.getElementById("blanket-implementations-list");

if (blanket_list !== null) {
onEachLazy(blanket_list.getElementsByClassName("collapse-toggle"), function(e) {
collapser(e, collapse);
});
}
}
}

Expand Down

0 comments on commit ca14c56

Please sign in to comment.