@@ -328,15 +328,7 @@ impl DocFolder for Cache {
328328 search_type : get_index_search_type ( & item) ,
329329 } ) ;
330330
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 ( ) {
340332 self . aliases
341333 . entry ( alias. to_lowercase ( ) )
342334 . or_insert ( Vec :: with_capacity ( 1 ) )
@@ -378,9 +370,6 @@ impl DocFolder for Cache {
378370 | clean:: MacroItem ( ..)
379371 | clean:: ProcMacroItem ( ..)
380372 | clean:: VariantItem ( ..)
381- | clean:: StructFieldItem ( ..)
382- | clean:: TyMethodItem ( ..)
383- | clean:: MethodItem ( ..)
384373 if !self . stripped_mod =>
385374 {
386375 // 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 {
564553 parent_idx : None ,
565554 search_type : get_index_search_type ( & item) ,
566555 } ) ;
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 ( ) {
576557 aliases
577558 . entry ( alias. to_lowercase ( ) )
578559 . or_insert ( Vec :: with_capacity ( 1 ) )
@@ -619,22 +600,8 @@ fn build_index(krate: &clean::Crate, cache: &mut Cache) -> String {
619600 . map ( |module| shorten ( plain_summary_line ( module. doc_value ( ) ) ) )
620601 . unwrap_or ( String :: new ( ) ) ;
621602
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 < _ > > ( ) ;
638605
639606 #[ derive( Serialize ) ]
640607 struct CrateData < ' a > {
0 commit comments