@@ -574,10 +574,6 @@ fn build_index(krate: &clean::Crate, cache: &mut Cache) -> String {
574
574
// has since been learned.
575
575
for & ( did, ref item) in orphan_impl_items {
576
576
if let Some ( & ( ref fqp, _) ) = paths. get ( & did) {
577
- if item. name . is_none ( ) {
578
- // this is most likely from a typedef
579
- continue ;
580
- }
581
577
search_index. push ( IndexItem {
582
578
ty : item. type_ ( ) ,
583
579
name : item. name . clone ( ) . unwrap ( ) ,
@@ -596,23 +592,19 @@ fn build_index(krate: &clean::Crate, cache: &mut Cache) -> String {
596
592
let mut lastpathid = 0usize ;
597
593
598
594
for item in search_index {
599
- item. parent_idx = match item. parent {
600
- Some ( nodeid ) => Some ( if nodeid_to_pathid. contains_key ( & nodeid) {
595
+ item. parent_idx = item. parent . map ( |nodeid| {
596
+ if nodeid_to_pathid. contains_key ( & nodeid) {
601
597
* nodeid_to_pathid. get ( & nodeid) . expect ( "no pathid" )
602
598
} else {
603
599
let pathid = lastpathid;
604
600
nodeid_to_pathid. insert ( nodeid, pathid) ;
605
601
lastpathid += 1 ;
606
602
607
- if let Some ( & ( ref fqp, short) ) = paths. get ( & nodeid) {
608
- crate_paths. push ( ( short, fqp. last ( ) . expect ( "no fqp" ) . clone ( ) ) ) ;
609
- } else {
610
- continue ;
611
- }
603
+ let & ( ref fqp, short) = paths. get ( & nodeid) . unwrap ( ) ;
604
+ crate_paths. push ( ( short, fqp. last ( ) . unwrap ( ) . clone ( ) ) ) ;
612
605
pathid
613
- } ) ,
614
- None => None ,
615
- } ;
606
+ }
607
+ } ) ;
616
608
617
609
// Omit the parent path if it is same to that of the prior item.
618
610
if lastpath == item. path {
0 commit comments