about summary refs log tree commit diff
path: root/clippy_lints/src/mem_replace.rs
diff options
context:
space:
mode:
authorPhilipp Hansch <dev@phansch.net>2019-03-08 14:14:41 +0100
committerPhilipp Hansch <dev@phansch.net>2019-03-08 14:14:41 +0100
commit9d97ed6faa84cde61ea18208a7a3818cc80e1c8b (patch)
treeb10c505aa6badf25f12f96972a69d1e33779daf8 /clippy_lints/src/mem_replace.rs
parent00baf7a1118f4b8332a47f68e8bebbac963a5dcb (diff)
Refactor: Remove utils::opt_def_id
This removes some indirection. Probably this method was uplifted to
rustc at some point?
Diffstat (limited to 'clippy_lints/src/mem_replace.rs')
-rw-r--r--clippy_lints/src/mem_replace.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/clippy_lints/src/mem_replace.rs b/clippy_lints/src/mem_replace.rs
index 60193618aac..57b05ab108c 100644
--- a/clippy_lints/src/mem_replace.rs
+++ b/clippy_lints/src/mem_replace.rs
@@ -1,4 +1,4 @@
-use crate::utils::{match_def_path, match_qpath, opt_def_id, paths, snippet_with_applicability, span_lint_and_sugg};
+use crate::utils::{match_def_path, match_qpath, paths, snippet_with_applicability, span_lint_and_sugg};
 use if_chain::if_chain;
 use rustc::hir::{Expr, ExprKind, MutMutable, QPath};
 use rustc::lint::{LateContext, LateLintPass, LintArray, LintPass};
@@ -51,7 +51,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for MemReplace {
             if let ExprKind::Call(ref func, ref func_args) = expr.node;
             if func_args.len() == 2;
             if let ExprKind::Path(ref func_qpath) = func.node;
-            if let Some(def_id) = opt_def_id(cx.tables.qpath_def(func_qpath, func.hir_id));
+            if let Some(def_id) = cx.tables.qpath_def(func_qpath, func.hir_id).opt_def_id();
             if match_def_path(cx.tcx, def_id, &paths::MEM_REPLACE);
 
             // Check that second argument is `Option::None`