@@ -1129,9 +1129,36 @@ pub struct IdMap {
1129
1129
map : FxHashMap < String , usize > ,
1130
1130
}
1131
1131
1132
+ fn init_id_map ( ) -> FxHashMap < String , usize > {
1133
+ let mut map = FxHashMap :: default ( ) ;
1134
+ // This is the list of IDs used by rustdoc templates.
1135
+ map. insert ( "mainThemeStyle" . to_owned ( ) , 1 ) ;
1136
+ map. insert ( "themeStyle" . to_owned ( ) , 1 ) ;
1137
+ map. insert ( "theme-picker" . to_owned ( ) , 1 ) ;
1138
+ map. insert ( "theme-choices" . to_owned ( ) , 1 ) ;
1139
+ map. insert ( "settings-menu" . to_owned ( ) , 1 ) ;
1140
+ map. insert ( "main" . to_owned ( ) , 1 ) ;
1141
+ map. insert ( "search" . to_owned ( ) , 1 ) ;
1142
+ map. insert ( "crate-search" . to_owned ( ) , 1 ) ;
1143
+ map. insert ( "render-detail" . to_owned ( ) , 1 ) ;
1144
+ map. insert ( "toggle-all-docs" . to_owned ( ) , 1 ) ;
1145
+ map. insert ( "all-types" . to_owned ( ) , 1 ) ;
1146
+ // This is the list of IDs used by rustdoc sections.
1147
+ map. insert ( "fields" . to_owned ( ) , 1 ) ;
1148
+ map. insert ( "variants" . to_owned ( ) , 1 ) ;
1149
+ map. insert ( "implementors-list" . to_owned ( ) , 1 ) ;
1150
+ map. insert ( "synthetic-implementors-list" . to_owned ( ) , 1 ) ;
1151
+ map. insert ( "implementations" . to_owned ( ) , 1 ) ;
1152
+ map. insert ( "trait-implementations" . to_owned ( ) , 1 ) ;
1153
+ map. insert ( "synthetic-implementations" . to_owned ( ) , 1 ) ;
1154
+ map. insert ( "blanket-implementations" . to_owned ( ) , 1 ) ;
1155
+ map. insert ( "deref-methods" . to_owned ( ) , 1 ) ;
1156
+ map
1157
+ }
1158
+
1132
1159
impl IdMap {
1133
1160
pub fn new ( ) -> Self {
1134
- IdMap :: default ( )
1161
+ IdMap { map : init_id_map ( ) }
1135
1162
}
1136
1163
1137
1164
pub fn populate < I : IntoIterator < Item = String > > ( & mut self , ids : I ) {
@@ -1141,7 +1168,7 @@ impl IdMap {
1141
1168
}
1142
1169
1143
1170
pub fn reset ( & mut self ) {
1144
- self . map = FxHashMap :: default ( ) ;
1171
+ self . map = init_id_map ( ) ;
1145
1172
}
1146
1173
1147
1174
pub fn derive ( & mut self , candidate : String ) -> String {
0 commit comments