Skip to content

Commit 96c2e62

Browse files
committed
Auto merge of #5168 - lily-commure:chars_next_style, r=flip1995
Reclassify chars_next_cmp as a style lint. This makes it consistent with chars_last_cmp. changelog: none
2 parents 06777d5 + 385fd7c commit 96c2e62

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

clippy_lints/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1412,6 +1412,7 @@ pub fn register_plugins(store: &mut rustc_lint::LintStore, sess: &Session, conf:
14121412
LintId::of(&mem_replace::MEM_REPLACE_OPTION_WITH_NONE),
14131413
LintId::of(&mem_replace::MEM_REPLACE_WITH_DEFAULT),
14141414
LintId::of(&methods::CHARS_LAST_CMP),
1415+
LintId::of(&methods::CHARS_NEXT_CMP),
14151416
LintId::of(&methods::INTO_ITER_ON_REF),
14161417
LintId::of(&methods::ITER_CLONED_COLLECT),
14171418
LintId::of(&methods::ITER_NTH_ZERO),
@@ -1494,7 +1495,6 @@ pub fn register_plugins(store: &mut rustc_lint::LintStore, sess: &Session, conf:
14941495
LintId::of(&matches::MATCH_AS_REF),
14951496
LintId::of(&matches::MATCH_SINGLE_BINDING),
14961497
LintId::of(&matches::WILDCARD_IN_OR_PATTERNS),
1497-
LintId::of(&methods::CHARS_NEXT_CMP),
14981498
LintId::of(&methods::CLONE_ON_COPY),
14991499
LintId::of(&methods::FILTER_NEXT),
15001500
LintId::of(&methods::FLAT_MAP_IDENTITY),

clippy_lints/src/methods/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -551,7 +551,7 @@ declare_clippy_lint! {
551551
/// if name.starts_with('_') {};
552552
/// ```
553553
pub CHARS_NEXT_CMP,
554-
complexity,
554+
style,
555555
"using `.chars().next()` to check if a string starts with a char"
556556
}
557557

src/lintlist/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ pub const ALL_LINTS: [Lint; 355] = [
191191
},
192192
Lint {
193193
name: "chars_next_cmp",
194-
group: "complexity",
194+
group: "style",
195195
desc: "using `.chars().next()` to check if a string starts with a char",
196196
deprecation: None,
197197
module: "methods",

0 commit comments

Comments
 (0)