Centralize more paths

This commit is contained in:
mcarton 2016-04-26 13:43:23 +02:00
parent cf5c1ab0b6
commit 0664394a49
2 changed files with 3 additions and 3 deletions

View file

@ -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!(

View file

@ -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"];