diff options
| author | Oliver Scherer <github35764891676564198441@oli-obk.de> | 2019-05-14 01:34:08 +0200 |
|---|---|---|
| committer | Oliver Scherer <github35764891676564198441@oli-obk.de> | 2019-05-14 10:33:42 +0200 |
| commit | b2dbda4d480a9256975448155d39b3b62653a4cf (patch) | |
| tree | 98b5a6bbfc801ef022706f089e8d6bcce6890178 /clippy_lints/src/mem_replace.rs | |
| parent | 42480fd0313028c40b103700dcb03da25f248685 (diff) | |
Use symbols instead of strings
Diffstat (limited to 'clippy_lints/src/mem_replace.rs')
| -rw-r--r-- | clippy_lints/src/mem_replace.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/clippy_lints/src/mem_replace.rs b/clippy_lints/src/mem_replace.rs index ee4780c10e6..3f43b8e42e4 100644 --- a/clippy_lints/src/mem_replace.rs +++ b/clippy_lints/src/mem_replace.rs @@ -1,4 +1,4 @@ -use crate::utils::{match_qpath, paths, snippet_with_applicability, span_lint_and_sugg}; +use crate::utils::{match_qpath, paths, snippet_with_applicability, span_lint_and_sugg, match_def_path}; use if_chain::if_chain; use rustc::hir::{Expr, ExprKind, MutMutable, QPath}; use rustc::lint::{LateContext, LateLintPass, LintArray, LintPass}; @@ -42,11 +42,11 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for MemReplace { if func_args.len() == 2; if let ExprKind::Path(ref func_qpath) = func.node; if let Some(def_id) = cx.tables.qpath_res(func_qpath, func.hir_id).opt_def_id(); - if cx.match_def_path(def_id, &paths::MEM_REPLACE); + if match_def_path(cx, def_id, &*paths::MEM_REPLACE); // Check that second argument is `Option::None` if let ExprKind::Path(ref replacement_qpath) = func_args[1].node; - if match_qpath(replacement_qpath, &paths::OPTION_NONE); + if match_qpath(replacement_qpath, &*paths::OPTION_NONE); then { // Since this is a late pass (already type-checked), |
