about summary refs log tree commit diff
path: root/src/librustc_interface
diff options
context:
space:
mode:
authorMatthias Krüger <matthias.krueger@famsik.de>2020-04-25 10:17:14 +0200
committerMatthias Krüger <matthias.krueger@famsik.de>2020-04-26 02:24:01 +0200
commit8862f829bbfbc25a2b4e02210a94907787d1cd8b (patch)
tree763f6b070088037c1dd57fd85d99e8068755f271 /src/librustc_interface
parent0862458dad90a0d80827e22e3f86e33add6d847c (diff)
fix more clippy warnings
clippy::{redundant_pattern_matching, clone_on_copy, iter_cloned_collect, option_as_ref_deref, match_ref_pats}
Diffstat (limited to 'src/librustc_interface')
-rw-r--r--src/librustc_interface/util.rs8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/librustc_interface/util.rs b/src/librustc_interface/util.rs
index fda01725443..367dc4dee7e 100644
--- a/src/librustc_interface/util.rs
+++ b/src/librustc_interface/util.rs
@@ -625,8 +625,8 @@ impl<'a, 'b> ReplaceBodyWithLoop<'a, 'b> {
                     | ast::TyKind::Rptr(_, ast::MutTy { ty: ref subty, .. })
                     | ast::TyKind::Paren(ref subty) => involves_impl_trait(subty),
                     ast::TyKind::Tup(ref tys) => any_involves_impl_trait(tys.iter()),
-                    ast::TyKind::Path(_, ref path) => path.segments.iter().any(|seg| {
-                        match seg.args.as_ref().map(|generic_arg| &**generic_arg) {
+                    ast::TyKind::Path(_, ref path) => {
+                        path.segments.iter().any(|seg| match seg.args.as_deref() {
                             None => false,
                             Some(&ast::GenericArgs::AngleBracketed(ref data)) => {
                                 data.args.iter().any(|arg| match arg {
@@ -647,8 +647,8 @@ impl<'a, 'b> ReplaceBodyWithLoop<'a, 'b> {
                                 any_involves_impl_trait(data.inputs.iter())
                                     || ReplaceBodyWithLoop::should_ignore_fn(&data.output)
                             }
-                        }
-                    }),
+                        })
+                    }
                     _ => false,
                 }
             }