@@ -328,15 +328,7 @@ impl DocFolder for Cache {
328
328
search_type : get_index_search_type ( & item) ,
329
329
} ) ;
330
330
331
- for alias in item
332
- . attrs
333
- . lists ( sym:: doc)
334
- . filter ( |a| a. check_name ( sym:: alias) )
335
- . filter_map ( |a| a. value_str ( ) . map ( |s| s. to_string ( ) . replace ( "\" " , "" ) ) )
336
- . filter ( |v| !v. is_empty ( ) )
337
- . collect :: < FxHashSet < _ > > ( )
338
- . into_iter ( )
339
- {
331
+ for alias in item. attrs . get_doc_aliases ( ) {
340
332
self . aliases
341
333
. entry ( alias. to_lowercase ( ) )
342
334
. or_insert ( Vec :: with_capacity ( 1 ) )
@@ -378,9 +370,6 @@ impl DocFolder for Cache {
378
370
| clean:: MacroItem ( ..)
379
371
| clean:: ProcMacroItem ( ..)
380
372
| clean:: VariantItem ( ..)
381
- | clean:: StructFieldItem ( ..)
382
- | clean:: TyMethodItem ( ..)
383
- | clean:: MethodItem ( ..)
384
373
if !self . stripped_mod =>
385
374
{
386
375
// Re-exported items mean that the same id can show up twice
@@ -564,15 +553,7 @@ fn build_index(krate: &clean::Crate, cache: &mut Cache) -> String {
564
553
parent_idx : None ,
565
554
search_type : get_index_search_type ( & item) ,
566
555
} ) ;
567
- for alias in item
568
- . attrs
569
- . lists ( sym:: doc)
570
- . filter ( |a| a. check_name ( sym:: alias) )
571
- . filter_map ( |a| a. value_str ( ) . map ( |s| s. to_string ( ) . replace ( "\" " , "" ) ) )
572
- . filter ( |v| !v. is_empty ( ) )
573
- . collect :: < FxHashSet < _ > > ( )
574
- . into_iter ( )
575
- {
556
+ for alias in item. attrs . get_doc_aliases ( ) . into_iter ( ) {
576
557
aliases
577
558
. entry ( alias. to_lowercase ( ) )
578
559
. or_insert ( Vec :: with_capacity ( 1 ) )
@@ -619,22 +600,8 @@ fn build_index(krate: &clean::Crate, cache: &mut Cache) -> String {
619
600
. map ( |module| shorten ( plain_summary_line ( module. doc_value ( ) ) ) )
620
601
. unwrap_or ( String :: new ( ) ) ;
621
602
622
- let crate_aliases = aliases
623
- . iter ( )
624
- . map ( |( k, values) | {
625
- (
626
- k. clone ( ) ,
627
- values
628
- . iter ( )
629
- . filter_map ( |v| {
630
- let x = & crate_items[ * v] ;
631
- if x. parent_idx . is_some ( ) == x. parent . is_some ( ) { Some ( * v) } else { None }
632
- } )
633
- . collect :: < Vec < _ > > ( ) ,
634
- )
635
- } )
636
- . filter ( |( _, values) | !values. is_empty ( ) )
637
- . collect :: < Vec < _ > > ( ) ;
603
+ let crate_aliases =
604
+ aliases. iter ( ) . map ( |( k, values) | ( k. clone ( ) , values. clone ( ) ) ) . collect :: < Vec < _ > > ( ) ;
638
605
639
606
#[ derive( Serialize ) ]
640
607
struct CrateData < ' a > {
0 commit comments