]> git.lizzy.rs Git - rust.git/blobdiff - clippy_lints/src/needless_borrow.rs
use BindingAnnotation instead of BindingMode
[rust.git] / clippy_lints / src / needless_borrow.rs
index c1965be2c04893a7a55be35ebc3c68a82e0c97a5..385fcc86adb6a50f8fce8fe28cb89946c8da4737 100644 (file)
@@ -3,7 +3,7 @@
 //! This lint is **warn** by default
 
 use rustc::lint::*;
-use rustc::hir::{ExprAddrOf, Expr, MutImmutable, Pat, PatKind, BindingMode};
+use rustc::hir::{ExprAddrOf, Expr, MutImmutable, Pat, PatKind, BindingAnnotation};
 use rustc::ty;
 use rustc::ty::adjustment::{Adjustment, Adjust};
 use utils::{span_lint, in_macro};
@@ -63,7 +63,7 @@ fn check_pat(&mut self, cx: &LateContext<'a, 'tcx>, pat: &'tcx Pat) {
             return;
         }
         if_let_chain! {[
-            let PatKind::Binding(BindingMode::BindByRef(MutImmutable), _, _, _) = pat.node,
+            let PatKind::Binding(BindingAnnotation::Ref, _, _, _) = pat.node,
             let ty::TyRef(_, ref tam) = cx.tables.pat_ty(pat).sty,
             tam.mutbl == MutImmutable,
             let ty::TyRef(_, ref tam) = tam.ty.sty,