@@ -916,7 +916,6 @@ function hideThemeButtonState() {
916916 return ;
917917 }
918918 if ( hasClass ( innerToggle , "will-expand" ) ) {
919- updateLocalStorage ( "rustdoc-collapse" , "false" ) ;
920919 removeClass ( innerToggle , "will-expand" ) ;
921920 onEachLazy ( document . getElementsByTagName ( "details" ) , function ( e ) {
922921 e . open = true ;
@@ -931,7 +930,6 @@ function hideThemeButtonState() {
931930 } ) ;
932931 }
933932 } else {
934- updateLocalStorage ( "rustdoc-collapse" , "true" ) ;
935933 addClass ( innerToggle , "will-expand" ) ;
936934 onEachLazy ( document . getElementsByTagName ( "details" ) , function ( e ) {
937935 e . open = false ;
@@ -1086,40 +1084,18 @@ function hideThemeButtonState() {
10861084 }
10871085 }
10881086
1089- function collapser ( e , collapse ) {
1087+ function collapseNonInherent ( e ) {
10901088 // inherent impl ids are like "impl" or impl-<number>'.
10911089 // they will never be hidden by default.
10921090 var n = e . parentElement ;
10931091 if ( n . id . match ( / ^ i m p l (?: - \d + ) ? $ / ) === null ) {
10941092 // Automatically minimize all non-inherent impls
1095- if ( collapse || hasClass ( n , "impl" ) ) {
1093+ if ( hasClass ( n , "impl" ) ) {
10961094 collapseDocs ( e , "hide" ) ;
10971095 }
10981096 }
10991097 }
11001098
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-
11231099 function insertAfter ( newNode , referenceNode ) {
11241100 referenceNode . parentNode . insertBefore ( newNode , referenceNode . nextSibling ) ;
11251101 }
@@ -1178,6 +1154,22 @@ function hideThemeButtonState() {
11781154 var hideMethodDocs = getSettingValue ( "auto-hide-method-docs" ) === "true" ;
11791155 var hideImplementors = getSettingValue ( "auto-collapse-implementors" ) !== "false" ;
11801156 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+ }
11811173
11821174 var func = function ( e ) {
11831175 var next = e . nextElementSibling ;
@@ -1348,8 +1340,6 @@ function hideThemeButtonState() {
13481340
13491341 onEachLazy ( document . getElementsByClassName ( "docblock" ) , buildToggleWrapper ) ;
13501342
1351- autoCollapse ( getSettingValue ( "collapse" ) === "true" ) ;
1352-
13531343 var pageId = getPageId ( ) ;
13541344 if ( pageId !== null ) {
13551345 expandSection ( pageId ) ;
0 commit comments