@@ -916,7 +916,6 @@ function hideThemeButtonState() {
916
916
return ;
917
917
}
918
918
if ( hasClass ( innerToggle , "will-expand" ) ) {
919
- updateLocalStorage ( "rustdoc-collapse" , "false" ) ;
920
919
removeClass ( innerToggle , "will-expand" ) ;
921
920
onEachLazy ( document . getElementsByTagName ( "details" ) , function ( e ) {
922
921
e . open = true ;
@@ -931,7 +930,6 @@ function hideThemeButtonState() {
931
930
} ) ;
932
931
}
933
932
} else {
934
- updateLocalStorage ( "rustdoc-collapse" , "true" ) ;
935
933
addClass ( innerToggle , "will-expand" ) ;
936
934
onEachLazy ( document . getElementsByTagName ( "details" ) , function ( e ) {
937
935
e . open = false ;
@@ -1086,40 +1084,18 @@ function hideThemeButtonState() {
1086
1084
}
1087
1085
}
1088
1086
1089
- function collapser ( e , collapse ) {
1087
+ function collapseNonInherent ( e ) {
1090
1088
// inherent impl ids are like "impl" or impl-<number>'.
1091
1089
// they will never be hidden by default.
1092
1090
var n = e . parentElement ;
1093
1091
if ( n . id . match ( / ^ i m p l (?: - \d + ) ? $ / ) === null ) {
1094
1092
// Automatically minimize all non-inherent impls
1095
- if ( collapse || hasClass ( n , "impl" ) ) {
1093
+ if ( hasClass ( n , "impl" ) ) {
1096
1094
collapseDocs ( e , "hide" ) ;
1097
1095
}
1098
1096
}
1099
1097
}
1100
1098
1101
- function autoCollapse ( collapse ) {
1102
- if ( collapse ) {
1103
- toggleAllDocs ( true ) ;
1104
- } else if ( getSettingValue ( "auto-hide-trait-implementations" ) !== "false" ) {
1105
- var impl_list = document . getElementById ( "trait-implementations-list" ) ;
1106
-
1107
- if ( impl_list !== null ) {
1108
- onEachLazy ( impl_list . getElementsByClassName ( "collapse-toggle" ) , function ( e ) {
1109
- collapser ( e , collapse ) ;
1110
- } ) ;
1111
- }
1112
-
1113
- var blanket_list = document . getElementById ( "blanket-implementations-list" ) ;
1114
-
1115
- if ( blanket_list !== null ) {
1116
- onEachLazy ( blanket_list . getElementsByClassName ( "collapse-toggle" ) , function ( e ) {
1117
- collapser ( e , collapse ) ;
1118
- } ) ;
1119
- }
1120
- }
1121
- }
1122
-
1123
1099
function insertAfter ( newNode , referenceNode ) {
1124
1100
referenceNode . parentNode . insertBefore ( newNode , referenceNode . nextSibling ) ;
1125
1101
}
@@ -1178,6 +1154,22 @@ function hideThemeButtonState() {
1178
1154
var hideMethodDocs = getSettingValue ( "auto-hide-method-docs" ) === "true" ;
1179
1155
var hideImplementors = getSettingValue ( "auto-collapse-implementors" ) !== "false" ;
1180
1156
var hideLargeItemContents = getSettingValue ( "auto-hide-large-items" ) !== "false" ;
1157
+ var hideTraitImplementations =
1158
+ getSettingValue ( "auto-hide-trait-implementations" ) !== "false" ;
1159
+
1160
+ var impl_list = document . getElementById ( "trait-implementations-list" ) ;
1161
+ if ( impl_list !== null ) {
1162
+ onEachLazy ( impl_list . getElementsByClassName ( "collapse-toggle" ) , function ( e ) {
1163
+ collapseNonInherent ( e ) ;
1164
+ } ) ;
1165
+ }
1166
+
1167
+ var blanket_list = document . getElementById ( "blanket-implementations-list" ) ;
1168
+ if ( blanket_list !== null ) {
1169
+ onEachLazy ( blanket_list . getElementsByClassName ( "collapse-toggle" ) , function ( e ) {
1170
+ collapseNonInherent ( e ) ;
1171
+ } ) ;
1172
+ }
1181
1173
1182
1174
var func = function ( e ) {
1183
1175
var next = e . nextElementSibling ;
@@ -1348,8 +1340,6 @@ function hideThemeButtonState() {
1348
1340
1349
1341
onEachLazy ( document . getElementsByClassName ( "docblock" ) , buildToggleWrapper ) ;
1350
1342
1351
- autoCollapse ( getSettingValue ( "collapse" ) === "true" ) ;
1352
-
1353
1343
var pageId = getPageId ( ) ;
1354
1344
if ( pageId !== null ) {
1355
1345
expandSection ( pageId ) ;
0 commit comments