From 99df3406cf419cb5e45f5ee59c7b04cb294630c5 Mon Sep 17 00:00:00 2001 From: Guillaume Gomez Date: Mon, 7 Dec 2020 15:13:12 +0100 Subject: [PATCH] Hide associated constants too when collapsing implementation --- src/librustdoc/html/static/main.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/librustdoc/html/static/main.js b/src/librustdoc/html/static/main.js index 69984be5eb622..0c55a61bb7d00 100644 --- a/src/librustdoc/html/static/main.js +++ b/src/librustdoc/html/static/main.js @@ -2257,9 +2257,12 @@ function defocusSearchBar() { function implHider(addOrRemove, fullHide) { return function(n) { - var is_method = hasClass(n, "method") || fullHide; - if (is_method || hasClass(n, "type")) { - if (is_method === true) { + var shouldHide = + fullHide === true || + hasClass(n, "method") === true || + hasClass(n, "associatedconstant") === true; + if (shouldHide === true || hasClass(n, "type") === true) { + if (shouldHide === true) { if (addOrRemove) { addClass(n, "hidden-by-impl-hider"); } else {