From 5556d89f560ae2948f2bb3ce5415ba6aff6aca4f Mon Sep 17 00:00:00 2001 From: llogiq Date: Mon, 18 May 2015 11:36:56 +0200 Subject: [PATCH] removed ty_ptr match --- src/mut_mut.rs | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/mut_mut.rs b/src/mut_mut.rs index 5d50e3513..2a71b938d 100644 --- a/src/mut_mut.rs +++ b/src/mut_mut.rs @@ -28,12 +28,9 @@ impl LintPass for MutMut { cx.span_lint(MUT_MUT, expr.span, "Generally you want to avoid &mut &mut _ if possible.") } else { - match expr_ty(cx.tcx, e).sty { - ty_ptr(mt{ty: _, mutbl: MutMutable}) | - ty_rptr(_, mt{ty: _, mutbl: MutMutable}) => - cx.span_lint(MUT_MUT, expr.span, - "This expression mutably borrows a mutable reference. Consider reborrowing"), - _ => () + if let ty_rptr(_, mt{ty: _, mutbl: MutMutable}) = expr_ty(cx.tcx, e).sty { + cx.span_lint(MUT_MUT, expr.span, + "This expression mutably borrows a mutable reference. Consider reborrowing") } } });