Skip to content

Commit da18df2

Browse files
committed
doc: make impl block collapsible if it has an associated constant
Fixes #71822.
1 parent 783139b commit da18df2

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/librustdoc/html/static/main.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -2366,7 +2366,9 @@ function defocusSearchBar() {
23662366
if (!next) {
23672367
return;
23682368
}
2369-
if (next.getElementsByClassName("method").length > 0 && hasClass(e, "impl")) {
2369+
if (hasClass(e, "impl") &&
2370+
(next.getElementsByClassName("method").length > 0 ||
2371+
next.getElementsByClassName("associatedconstant").length > 0)) {
23702372
insertAfter(toggle.cloneNode(true), e.childNodes[e.childNodes.length - 1]);
23712373
}
23722374
};

0 commit comments

Comments
 (0)