Skip to content

Commit 1a69f84

Browse files
committed
downgrade to pedantic
1 parent 58c53e8 commit 1a69f84

File tree

3 files changed

+7
-5
lines changed

3 files changed

+7
-5
lines changed

clippy_lints/src/methods/mod.rs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1145,8 +1145,10 @@ declare_clippy_lint! {
11451145
/// `str` as an argument, e.g., `_.split("x")`.
11461146
///
11471147
/// ### Why is this bad?
1148-
/// Performing these methods using a `char` can be faster than
1149-
/// using a `str` because it needs one less indirection.
1148+
/// While this can make a perf difference on some systems,
1149+
/// benchmarks have proven inconclusive. But at least using a
1150+
/// char literal makes it clear that we are looking at a single
1151+
/// character.
11501152
///
11511153
/// ### Known problems
11521154
/// Does not catch multi-byte unicode characters. This is by
@@ -1165,7 +1167,7 @@ declare_clippy_lint! {
11651167
/// ```
11661168
#[clippy::version = "pre 1.29.0"]
11671169
pub SINGLE_CHAR_PATTERN,
1168-
perf,
1170+
pedantic,
11691171
"using a single-character str where a char could be used, e.g., `_.split(\"x\")`"
11701172
}
11711173

tests/ui/single_char_pattern.fixed

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#![allow(clippy::needless_raw_strings, clippy::needless_raw_string_hashes, unused_must_use)]
2-
2+
#![warn(clippy::single_char_pattern)]
33
use std::collections::HashSet;
44

55
fn main() {

tests/ui/single_char_pattern.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#![allow(clippy::needless_raw_strings, clippy::needless_raw_string_hashes, unused_must_use)]
2-
2+
#![warn(clippy::single_char_pattern)]
33
use std::collections::HashSet;
44

55
fn main() {

0 commit comments

Comments
 (0)