]> git.lizzy.rs Git - rust.git/blobdiff - src/librustdoc/passes/collect_trait_impls.rs
remove unused return types such as empty Results or Options that would always be...
[rust.git] / src / librustdoc / passes / collect_trait_impls.rs
index 60fcbe748727d445e9bf61d776df9dda48668310..9b0ae09cb3fd57c9f660faf22a5f6514ebc2b7f2 100644 (file)
 
     // scan through included items ahead of time to splice in Deref targets to the "valid" sets
     for it in &new_items {
-        if let ImplItem(Impl { ref for_, ref trait_, ref items, .. }) = it.kind {
+        if let ImplItem(Impl { ref for_, ref trait_, ref items, .. }) = *it.kind {
             if cleaner.keep_item(for_) && trait_.def_id() == cx.tcx.lang_items().deref_trait() {
                 let target = items
                     .iter()
-                    .find_map(|item| match item.kind {
+                    .find_map(|item| match *item.kind {
                         TypedefItem(ref t, true) => Some(&t.type_),
                         _ => None,
                     })
@@ -78,7 +78,7 @@
     }
 
     new_items.retain(|it| {
-        if let ImplItem(Impl { ref for_, ref trait_, ref blanket_impl, .. }) = it.kind {
+        if let ImplItem(Impl { ref for_, ref trait_, ref blanket_impl, .. }) = *it.kind {
             cleaner.keep_item(for_)
                 || trait_.as_ref().map_or(false, |t| cleaner.keep_item(t))
                 || blanket_impl.is_some()
     }
 
     if let Some(ref mut it) = krate.module {
-        if let ModuleItem(Module { ref mut items, .. }) = it.kind {
+        if let ModuleItem(Module { ref mut items, .. }) = *it.kind {
             items.extend(synth.impls);
             items.extend(new_items);
         } else {