Skip to content

Commit ff51964

Browse files
committed
Auto merge of #6825 - djc:naive-bytecount-pedantic, r=Manishearth
Move naive_bytecount to pedantic As discussed on Zulip, current best practice is to avoid recommending external crates. This lint is from before that was enforced. Move it to the pedantic group to avoid enabling it by default. https://rust-lang.zulipchat.com/#narrow/stream/257328-clippy/topic/naive_bytecount.20suggesting.20extra.20dependency changelog: move [`naive_bytecount`] to pedantic
2 parents 43d19f6 + 9e4a064 commit ff51964

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

clippy_lints/src/bytecount.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ declare_clippy_lint! {
2828
/// &vec.iter().filter(|x| **x == 0u8).count(); // use bytecount::count instead
2929
/// ```
3030
pub NAIVE_BYTECOUNT,
31-
perf,
31+
pedantic,
3232
"use of naive `<slice>.filter(|&x| x == y).count()` to count byte values"
3333
}
3434

clippy_lints/src/lib.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1343,6 +1343,7 @@ pub fn register_plugins(store: &mut rustc_lint::LintStore, sess: &Session, conf:
13431343
LintId::of(&await_holding_invalid::AWAIT_HOLDING_LOCK),
13441344
LintId::of(&await_holding_invalid::AWAIT_HOLDING_REFCELL_REF),
13451345
LintId::of(&bit_mask::VERBOSE_BIT_MASK),
1346+
LintId::of(&bytecount::NAIVE_BYTECOUNT),
13461347
LintId::of(&case_sensitive_file_extension_comparisons::CASE_SENSITIVE_FILE_EXTENSION_COMPARISONS),
13471348
LintId::of(&checked_conversions::CHECKED_CONVERSIONS),
13481349
LintId::of(&copies::SAME_FUNCTIONS_IN_IF_CONDITION),
@@ -1458,7 +1459,6 @@ pub fn register_plugins(store: &mut rustc_lint::LintStore, sess: &Session, conf:
14581459
LintId::of(&blocks_in_if_conditions::BLOCKS_IN_IF_CONDITIONS),
14591460
LintId::of(&booleans::LOGIC_BUG),
14601461
LintId::of(&booleans::NONMINIMAL_BOOL),
1461-
LintId::of(&bytecount::NAIVE_BYTECOUNT),
14621462
LintId::of(&collapsible_if::COLLAPSIBLE_ELSE_IF),
14631463
LintId::of(&collapsible_if::COLLAPSIBLE_IF),
14641464
LintId::of(&collapsible_match::COLLAPSIBLE_MATCH),
@@ -2015,7 +2015,6 @@ pub fn register_plugins(store: &mut rustc_lint::LintStore, sess: &Session, conf:
20152015
]);
20162016

20172017
store.register_group(true, "clippy::perf", Some("clippy_perf"), vec![
2018-
LintId::of(&bytecount::NAIVE_BYTECOUNT),
20192018
LintId::of(&entry::MAP_ENTRY),
20202019
LintId::of(&escape::BOXED_LOCAL),
20212020
LintId::of(&large_const_arrays::LARGE_CONST_ARRAYS),

0 commit comments

Comments
 (0)