]> git.lizzy.rs Git - rust.git/blobdiff - src/librustdoc/passes/strip_hidden.rs
remove unused return types such as empty Results or Options that would always be...
[rust.git] / src / librustdoc / passes / strip_hidden.rs
index 6da753ea6e695b91c5bd7271a752c2e34513ff22..01e3d0acaa8555689e7caafc59b5a290659ecc94 100644 (file)
@@ -41,15 +41,15 @@ fn fold_item(&mut self, i: Item) -> Option<Item> {
         if i.attrs.lists(sym::doc).has_word(sym::hidden) {
             debug!("strip_hidden: stripping {:?} {:?}", i.type_(), i.name);
             // use a dedicated hidden item for given item type if any
-            match i.kind {
+            match *i.kind {
                 clean::StructFieldItem(..) | clean::ModuleItem(..) => {
                     // We need to recurse into stripped modules to
                     // strip things like impl methods but when doing so
                     // we must not add any items to the `retained` set.
                     let old = mem::replace(&mut self.update_retained, false);
-                    let ret = StripItem(self.fold_item_recur(i).unwrap()).strip();
+                    let ret = StripItem(self.fold_item_recur(i)).strip();
                     self.update_retained = old;
-                    return ret;
+                    return Some(ret);
                 }
                 _ => return None,
             }
@@ -58,6 +58,6 @@ fn fold_item(&mut self, i: Item) -> Option<Item> {
                 self.retained.insert(i.def_id);
             }
         }
-        self.fold_item_recur(i)
+        Some(self.fold_item_recur(i))
     }
 }