From 0664394a4901d0af7717ebf6abd99330ce301ab9 Mon Sep 17 00:00:00 2001 From: mcarton Date: Tue, 26 Apr 2016 13:43:23 +0200 Subject: [PATCH] Centralize more paths --- src/map_clone.rs | 2 +- src/utils/paths.rs | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/map_clone.rs b/src/map_clone.rs index 1a0620d88345..d015a165457a 100644 --- a/src/map_clone.rs +++ b/src/map_clone.rs @@ -51,7 +51,7 @@ impl LateLintPass for MapClonePass { else if let ExprMethodCall(clone_call, _, ref clone_args) = closure_expr.node { if clone_call.node.as_str() == "clone" && clone_args.len() == 1 && - match_trait_method(cx, closure_expr, &["core", "clone", "Clone"]) && + match_trait_method(cx, closure_expr, &paths::CLONE_TRAIT) && expr_eq_ident(&clone_args[0], arg_ident) { span_help_and_lint(cx, MAP_CLONE, expr.span, &format!( diff --git a/src/utils/paths.rs b/src/utils/paths.rs index 7da75c3cd55a..c52324a7448f 100644 --- a/src/utils/paths.rs +++ b/src/utils/paths.rs @@ -7,8 +7,8 @@ pub const BOX_NEW: [&'static str; 4] = ["std", "boxed", "Box", "new"]; pub const BTREEMAP: [&'static str; 4] = ["collections", "btree", "map", "BTreeMap"]; pub const BTREEMAP_ENTRY: [&'static str; 4] = ["collections", "btree", "map", "Entry"]; pub const BTREESET: [&'static str; 4] = ["collections", "btree", "set", "BTreeSet"]; -pub const CLONE: [&'static str; 3] = ["clone", "Clone", "clone"]; -pub const CLONE_TRAIT: [&'static str; 2] = ["clone", "Clone"]; +pub const CLONE: [&'static str; 4] = ["core", "clone", "Clone", "clone"]; +pub const CLONE_TRAIT: [&'static str; 3] = ["core", "clone", "Clone"]; pub const CMP_MAX: [&'static str; 3] = ["core", "cmp", "max"]; pub const CMP_MIN: [&'static str; 3] = ["core", "cmp", "min"]; pub const COW: [&'static str; 3] = ["collections", "borrow", "Cow"];