]> git.lizzy.rs Git - rust.git/commitdiff
Don't record the root module in the search index
authormitaa <mitaa.ceb@gmail.com>
Mon, 21 Dec 2015 02:21:56 +0000 (03:21 +0100)
committermitaa <mitaa.ceb@gmail.com>
Tue, 22 Dec 2015 18:10:08 +0000 (19:10 +0100)
src/librustdoc/html/render.rs

index 09a2a1b1c02699e46fb78243b5cf196a95325ed1..b9ebe977b7bd753eccfcc0a3f6b08486baa15427 100644 (file)
@@ -1058,14 +1058,16 @@ fn fold_item(&mut self, item: clean::Item) -> Option<clean::Item> {
                         }
                     });
 
-                    self.search_index.push(IndexItem {
-                        ty: shortty(&item),
-                        name: s.to_string(),
-                        path: path.join("::").to_string(),
-                        desc: shorter(item.doc_value()),
-                        parent: parent,
-                        search_type: get_index_search_type(&item, parent_basename),
-                    });
+                    if item.def_id.index != CRATE_DEF_INDEX {
+                        self.search_index.push(IndexItem {
+                            ty: shortty(&item),
+                            name: s.to_string(),
+                            path: path.join("::").to_string(),
+                            desc: shorter(item.doc_value()),
+                            parent: parent,
+                            search_type: get_index_search_type(&item, parent_basename),
+                        });
+                    }
                 }
                 (Some(parent), None) if is_method || (!self.privmod && !hidden_field)=> {
                     if parent.is_local() {