about summary refs log tree commit diff
path: root/src/librustdoc/html/render/cache.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/librustdoc/html/render/cache.rs')
-rw-r--r--src/librustdoc/html/render/cache.rs20
1 files changed, 6 insertions, 14 deletions
diff --git a/src/librustdoc/html/render/cache.rs b/src/librustdoc/html/render/cache.rs
index fd9c47d0c4a..f1f83acdda5 100644
--- a/src/librustdoc/html/render/cache.rs
+++ b/src/librustdoc/html/render/cache.rs
@@ -574,10 +574,6 @@ fn build_index(krate: &clean::Crate, cache: &mut Cache) -> String {
     // has since been learned.
     for &(did, ref item) in orphan_impl_items {
         if let Some(&(ref fqp, _)) = paths.get(&did) {
-            if item.name.is_none() {
-                // this is most likely from a typedef
-                continue;
-            }
             search_index.push(IndexItem {
                 ty: item.type_(),
                 name: item.name.clone().unwrap(),
@@ -596,23 +592,19 @@ fn build_index(krate: &clean::Crate, cache: &mut Cache) -> String {
     let mut lastpathid = 0usize;
 
     for item in search_index {
-        item.parent_idx = match item.parent {
-            Some(nodeid) => Some(if nodeid_to_pathid.contains_key(&nodeid) {
+        item.parent_idx = item.parent.map(|nodeid| {
+            if nodeid_to_pathid.contains_key(&nodeid) {
                 *nodeid_to_pathid.get(&nodeid).expect("no pathid")
             } else {
                 let pathid = lastpathid;
                 nodeid_to_pathid.insert(nodeid, pathid);
                 lastpathid += 1;
 
-                if let Some(&(ref fqp, short)) = paths.get(&nodeid) {
-                    crate_paths.push((short, fqp.last().expect("no fqp").clone()));
-                } else {
-                    continue;
-                }
+                let &(ref fqp, short) = paths.get(&nodeid).unwrap();
+                crate_paths.push((short, fqp.last().unwrap().clone()));
                 pathid
-            }),
-            None => None,
-        };
+            }
+        });
 
         // Omit the parent path if it is same to that of the prior item.
         if lastpath == item.path {