impl<'a> DocFolder for Stripper<'a> {
fn fold_item(&mut self, i: Item) -> Option<Item> {
- match i.kind {
+ match *i.kind {
clean::StrippedItem(..) => {
// We need to recurse into stripped modules to strip things
// like impl methods but when doing so we must not add any
clean::StructFieldItem(..) => {
if !i.visibility.is_public() {
- return StripItem(i).strip();
+ return Some(StripItem(i).strip());
}
}
let old = mem::replace(&mut self.update_retained, false);
let ret = StripItem(self.fold_item_recur(i)).strip();
self.update_retained = old;
- return ret;
+ return Some(ret);
}
}
clean::KeywordItem(..) => {}
}
- let fastreturn = match i.kind {
+ let fastreturn = match *i.kind {
// nothing left to do for traits (don't want to filter their
// methods out, visibility controlled by the trait)
clean::TraitItem(..) => true,
impl<'a> DocFolder for ImplStripper<'a> {
fn fold_item(&mut self, i: Item) -> Option<Item> {
- if let clean::ImplItem(ref imp) = i.kind {
+ if let clean::ImplItem(ref imp) = *i.kind {
// emptied none trait impls can be stripped
if imp.trait_.is_none() && imp.items.is_empty() {
return None;
impl DocFolder for ImportStripper {
fn fold_item(&mut self, i: Item) -> Option<Item> {
- match i.kind {
+ match *i.kind {
clean::ExternCrateItem(..) | clean::ImportItem(..) if !i.visibility.is_public() => None,
_ => Some(self.fold_item_recur(i)),
}