From 7e0af69f1ce02efc69ca67bd3792969a84949411 Mon Sep 17 00:00:00 2001 From: Lily Chung Date: Wed, 12 Feb 2020 16:50:29 -0800 Subject: [PATCH 1/2] Reclassify chars_next_cmp as a style lint. This makes it consistent with chars_last_cmp. --- src/lintlist/mod.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lintlist/mod.rs b/src/lintlist/mod.rs index d4f94a9b60a4..06a1fca4fdd8 100644 --- a/src/lintlist/mod.rs +++ b/src/lintlist/mod.rs @@ -191,7 +191,7 @@ pub const ALL_LINTS: [Lint; 355] = [ }, Lint { name: "chars_next_cmp", - group: "complexity", + group: "style", desc: "using `.chars().next()` to check if a string starts with a char", deprecation: None, module: "methods", From 385fd7cd0aa4d95a61962c20e62281c728447ea9 Mon Sep 17 00:00:00 2001 From: Lily Chung Date: Wed, 12 Feb 2020 17:03:49 -0800 Subject: [PATCH 2/2] change in the right place, run update_lints --- clippy_lints/src/lib.rs | 2 +- clippy_lints/src/methods/mod.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/clippy_lints/src/lib.rs b/clippy_lints/src/lib.rs index f900a99f314d..02cf2d06f04d 100644 --- a/clippy_lints/src/lib.rs +++ b/clippy_lints/src/lib.rs @@ -1412,6 +1412,7 @@ pub fn register_plugins(store: &mut rustc_lint::LintStore, sess: &Session, conf: LintId::of(&mem_replace::MEM_REPLACE_OPTION_WITH_NONE), LintId::of(&mem_replace::MEM_REPLACE_WITH_DEFAULT), LintId::of(&methods::CHARS_LAST_CMP), + LintId::of(&methods::CHARS_NEXT_CMP), LintId::of(&methods::INTO_ITER_ON_REF), LintId::of(&methods::ITER_CLONED_COLLECT), LintId::of(&methods::ITER_NTH_ZERO), @@ -1494,7 +1495,6 @@ pub fn register_plugins(store: &mut rustc_lint::LintStore, sess: &Session, conf: LintId::of(&matches::MATCH_AS_REF), LintId::of(&matches::MATCH_SINGLE_BINDING), LintId::of(&matches::WILDCARD_IN_OR_PATTERNS), - LintId::of(&methods::CHARS_NEXT_CMP), LintId::of(&methods::CLONE_ON_COPY), LintId::of(&methods::FILTER_NEXT), LintId::of(&methods::FLAT_MAP_IDENTITY), diff --git a/clippy_lints/src/methods/mod.rs b/clippy_lints/src/methods/mod.rs index 82bc8740d1af..716cd74ab92f 100644 --- a/clippy_lints/src/methods/mod.rs +++ b/clippy_lints/src/methods/mod.rs @@ -551,7 +551,7 @@ declare_clippy_lint! { /// if name.starts_with('_') {}; /// ``` pub CHARS_NEXT_CMP, - complexity, + style, "using `.chars().next()` to check if a string starts with a char" }