]> git.lizzy.rs Git - rust.git/blobdiff - clippy_lints/src/ptr.rs
BinOpKind
[rust.git] / clippy_lints / src / ptr.rs
index 68cecc8de678fb02f5ff42d98cac1c9f0737dd7c..2ecdf983e6bdafd76ad6f91d7a4bdd1bc9d00e69 100644 (file)
@@ -131,8 +131,8 @@ fn check_trait_item(&mut self, cx: &LateContext<'a, 'tcx>, item: &'tcx TraitItem
     }
 
     fn check_expr(&mut self, cx: &LateContext<'a, 'tcx>, expr: &'tcx Expr) {
-        if let ExprBinary(ref op, ref l, ref r) = expr.node {
-            if (op.node == BiEq || op.node == BiNe) && (is_null_path(l) || is_null_path(r)) {
+        if let ExprKind::Binary(ref op, ref l, ref r) = expr.node {
+            if (op.node == BinOpKind::Eq || op.node == BinOpKind::Ne) && (is_null_path(l) || is_null_path(r)) {
                 span_lint(
                     cx,
                     CMP_NULL,
@@ -281,9 +281,9 @@ fn get_rptr_lm(ty: &Ty) -> Option<(&Lifetime, Mutability, Span)> {
 }
 
 fn is_null_path(expr: &Expr) -> bool {
-    if let ExprCall(ref pathexp, ref args) = expr.node {
+    if let ExprKind::Call(ref pathexp, ref args) = expr.node {
         if args.is_empty() {
-            if let ExprPath(ref path) = pathexp.node {
+            if let ExprKind::Path(ref path) = pathexp.node {
                 return match_qpath(path, &paths::PTR_NULL) || match_qpath(path, &paths::PTR_NULL_MUT);
             }
         }