File tree 1 file changed +11
-6
lines changed
src/librustdoc/html/render 1 file changed +11
-6
lines changed Original file line number Diff line number Diff line change @@ -250,6 +250,8 @@ impl<'tcx> Context<'tcx> {
250
250
fn build_sidebar_items ( & self , m : & clean:: Module ) -> BTreeMap < String , Vec < NameDoc > > {
251
251
// BTreeMap instead of HashMap to get a sorted output
252
252
let mut map: BTreeMap < _ , Vec < _ > > = BTreeMap :: new ( ) ;
253
+ let mut inserted: FxHashMap < ItemType , FxHashSet < Symbol > > = FxHashMap :: default ( ) ;
254
+
253
255
for item in & m. items {
254
256
if item. is_stripped ( ) {
255
257
continue ;
@@ -258,13 +260,16 @@ impl<'tcx> Context<'tcx> {
258
260
let short = item. type_ ( ) ;
259
261
let myname = match item. name {
260
262
None => continue ,
261
- Some ( ref s) => s. to_string ( ) ,
263
+ Some ( s) => s,
262
264
} ;
263
- let short = short. to_string ( ) ;
264
- map. entry ( short) . or_default ( ) . push ( (
265
- myname,
266
- Some ( item. doc_value ( ) . map_or_else ( String :: new, |s| plain_text_summary ( & s) ) ) ,
267
- ) ) ;
265
+ if inserted. entry ( short) . or_default ( ) . insert ( myname) {
266
+ let short = short. to_string ( ) ;
267
+ let myname = myname. to_string ( ) ;
268
+ map. entry ( short) . or_default ( ) . push ( (
269
+ myname,
270
+ Some ( item. doc_value ( ) . map_or_else ( String :: new, |s| plain_text_summary ( & s) ) ) ,
271
+ ) ) ;
272
+ }
268
273
}
269
274
270
275
if self . shared . sort_modules_alphabetically {
You can’t perform that action at this time.
0 commit comments