FIx dogfood

This commit is contained in:
Oliver Schneider 2018-10-02 15:17:56 +02:00
parent b36bb0a68d
commit 696dc369df

View file

@ -70,11 +70,9 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for Pass {
},
hir::PatKind::Binding(hir::BindingAnnotation::Unannotated, _, name, None) => match closure_expr.node {
hir::ExprKind::Unary(hir::UnOp::UnDeref, ref inner) => lint(cx, e.span, args[0].span, name, inner),
hir::ExprKind::MethodCall(ref method, _, ref obj) => if method.ident.as_str() == "clone" {
if match_trait_method(cx, closure_expr, &paths::CLONE_TRAIT) {
hir::ExprKind::MethodCall(ref method, _, ref obj) => if method.ident.as_str() == "clone" && match_trait_method(cx, closure_expr, &paths::CLONE_TRAIT) {
lint(cx, e.span, args[0].span, name, &obj[0]);
}
}
_ => {},
},
_ => {},