Skip to content

Commit ca14c56

Browse files
authored
Rollup merge of #59534 - laurmaedje:collapse-blanket-impls, 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.)
2 parents 931151f + 9e4ec7a commit ca14c56

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/librustdoc/html/static/main.js

+8
Original file line numberDiff line numberDiff line change
@@ -2071,6 +2071,14 @@ if (!DOMTokenList.prototype.remove) {
20712071
collapser(e, collapse);
20722072
});
20732073
}
2074+
2075+
var blanket_list = document.getElementById("blanket-implementations-list");
2076+
2077+
if (blanket_list !== null) {
2078+
onEachLazy(blanket_list.getElementsByClassName("collapse-toggle"), function(e) {
2079+
collapser(e, collapse);
2080+
});
2081+
}
20742082
}
20752083
}
20762084

0 commit comments

Comments
 (0)