@@ -905,7 +905,6 @@ function hideThemeButtonState() {
905905 return ;
906906 }
907907 if ( hasClass ( innerToggle , "will-expand" ) ) {
908- updateLocalStorage ( "rustdoc-collapse" , "false" ) ;
909908 removeClass ( innerToggle , "will-expand" ) ;
910909 onEachLazy ( document . getElementsByTagName ( "details" ) , function ( e ) {
911910 e . open = true ;
@@ -920,7 +919,6 @@ function hideThemeButtonState() {
920919 } ) ;
921920 }
922921 } else {
923- updateLocalStorage ( "rustdoc-collapse" , "true" ) ;
924922 addClass ( innerToggle , "will-expand" ) ;
925923 onEachLazy ( document . getElementsByTagName ( "details" ) , function ( e ) {
926924 e . open = false ;
@@ -1075,7 +1073,7 @@ function hideThemeButtonState() {
10751073 }
10761074 }
10771075
1078- function collapser ( e , collapse ) {
1076+ function collapseNonInherent ( e , collapse ) {
10791077 // inherent impl ids are like "impl" or impl-<number>'.
10801078 // they will never be hidden by default.
10811079 var n = e . parentElement ;
@@ -1087,28 +1085,6 @@ function hideThemeButtonState() {
10871085 }
10881086 }
10891087
1090- function autoCollapse ( collapse ) {
1091- if ( collapse ) {
1092- toggleAllDocs ( true ) ;
1093- } else if ( getSettingValue ( "auto-hide-trait-implementations" ) !== "false" ) {
1094- var impl_list = document . getElementById ( "trait-implementations-list" ) ;
1095-
1096- if ( impl_list !== null ) {
1097- onEachLazy ( impl_list . getElementsByClassName ( "collapse-toggle" ) , function ( e ) {
1098- collapser ( e , collapse ) ;
1099- } ) ;
1100- }
1101-
1102- var blanket_list = document . getElementById ( "blanket-implementations-list" ) ;
1103-
1104- if ( blanket_list !== null ) {
1105- onEachLazy ( blanket_list . getElementsByClassName ( "collapse-toggle" ) , function ( e ) {
1106- collapser ( e , collapse ) ;
1107- } ) ;
1108- }
1109- }
1110- }
1111-
11121088 function insertAfter ( newNode , referenceNode ) {
11131089 referenceNode . parentNode . insertBefore ( newNode , referenceNode . nextSibling ) ;
11141090 }
@@ -1167,6 +1143,22 @@ function hideThemeButtonState() {
11671143 var hideMethodDocs = getSettingValue ( "auto-hide-method-docs" ) === "true" ;
11681144 var hideImplementors = getSettingValue ( "auto-collapse-implementors" ) !== "false" ;
11691145 var hideLargeItemContents = getSettingValue ( "auto-hide-large-items" ) !== "false" ;
1146+ var hideTraitImplementations =
1147+ getSettingValue ( "auto-hide-trait-implementations" ) !== "false" ;
1148+
1149+ var impl_list = document . getElementById ( "trait-implementations-list" ) ;
1150+ if ( impl_list !== null ) {
1151+ onEachLazy ( impl_list . getElementsByClassName ( "collapse-toggle" ) , function ( e ) {
1152+ collapseNonInherent ( e , collapse ) ;
1153+ } ) ;
1154+ }
1155+
1156+ var blanket_list = document . getElementById ( "blanket-implementations-list" ) ;
1157+ if ( blanket_list !== null ) {
1158+ onEachLazy ( blanket_list . getElementsByClassName ( "collapse-toggle" ) , function ( e ) {
1159+ collapseNonInherent ( e , collapse ) ;
1160+ } ) ;
1161+ }
11701162
11711163 var func = function ( e ) {
11721164 var next = e . nextElementSibling ;
@@ -1353,8 +1345,6 @@ function hideThemeButtonState() {
13531345 onEachLazy ( document . getElementsByClassName ( "docblock" ) , buildToggleWrapper ) ;
13541346 onEachLazy ( document . getElementsByClassName ( "sub-variant" ) , buildToggleWrapper ) ;
13551347
1356- autoCollapse ( getSettingValue ( "collapse" ) === "true" ) ;
1357-
13581348 var pageId = getPageId ( ) ;
13591349 if ( pageId !== null ) {
13601350 expandSection ( pageId ) ;
0 commit comments