Skip to content

Commit b592d39

Browse files
committed
manual_range_pattern -> manual_range_patterns
1 parent 1d4afc5 commit b592d39

11 files changed

+22
-22
lines changed

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4949,7 +4949,7 @@ Released 2018-09-13
49494949
[`manual_non_exhaustive`]: https://rust-lang.github.io/rust-clippy/master/index.html#manual_non_exhaustive
49504950
[`manual_ok_or`]: https://rust-lang.github.io/rust-clippy/master/index.html#manual_ok_or
49514951
[`manual_range_contains`]: https://rust-lang.github.io/rust-clippy/master/index.html#manual_range_contains
4952-
[`manual_range_pattern`]: https://rust-lang.github.io/rust-clippy/master/index.html#manual_range_pattern
4952+
[`manual_range_patterns`]: https://rust-lang.github.io/rust-clippy/master/index.html#manual_range_patterns
49534953
[`manual_rem_euclid`]: https://rust-lang.github.io/rust-clippy/master/index.html#manual_rem_euclid
49544954
[`manual_retain`]: https://rust-lang.github.io/rust-clippy/master/index.html#manual_retain
49554955
[`manual_saturating_arithmetic`]: https://rust-lang.github.io/rust-clippy/master/index.html#manual_saturating_arithmetic

clippy_lints/src/declared_lints.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -278,7 +278,7 @@ pub(crate) static LINTS: &[&crate::LintInfo] = &[
278278
crate::manual_let_else::MANUAL_LET_ELSE_INFO,
279279
crate::manual_main_separator_str::MANUAL_MAIN_SEPARATOR_STR_INFO,
280280
crate::manual_non_exhaustive::MANUAL_NON_EXHAUSTIVE_INFO,
281-
crate::manual_range_pattern::MANUAL_RANGE_PATTERN_INFO,
281+
crate::manual_range_patterns::MANUAL_RANGE_PATTERNS_INFO,
282282
crate::manual_rem_euclid::MANUAL_REM_EUCLID_INFO,
283283
crate::manual_retain::MANUAL_RETAIN_INFO,
284284
crate::manual_slice_size_calculation::MANUAL_SLICE_SIZE_CALCULATION_INFO,

clippy_lints/src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ mod manual_is_ascii_check;
188188
mod manual_let_else;
189189
mod manual_main_separator_str;
190190
mod manual_non_exhaustive;
191-
mod manual_range_pattern;
191+
mod manual_range_patterns;
192192
mod manual_rem_euclid;
193193
mod manual_retain;
194194
mod manual_slice_size_calculation;
@@ -1069,7 +1069,7 @@ pub fn register_plugins(store: &mut rustc_lint::LintStore, sess: &Session, conf:
10691069
needless_raw_string_hashes_allow_one,
10701070
})
10711071
});
1072-
store.register_late_pass(|_| Box::new(manual_range_pattern::ManualRangePattern));
1072+
store.register_late_pass(|_| Box::new(manual_range_patterns::ManualRangePatterns));
10731073
// add lints here, do not remove this comment, it's used in `new_lint`
10741074
}
10751075

clippy_lints/src/manual_range_pattern.rs renamed to clippy_lints/src/manual_range_patterns.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,11 @@ declare_clippy_lint! {
3030
/// let foo = matches!(x, 1..=10);
3131
/// ```
3232
#[clippy::version = "1.72.0"]
33-
pub MANUAL_RANGE_PATTERN,
33+
pub MANUAL_RANGE_PATTERNS,
3434
complexity,
3535
"manually writing range patterns using a combined OR pattern (`|`)"
3636
}
37-
declare_lint_pass!(ManualRangePattern => [MANUAL_RANGE_PATTERN]);
37+
declare_lint_pass!(ManualRangePatterns => [MANUAL_RANGE_PATTERNS]);
3838

3939
fn expr_as_u128(expr: &Expr<'_>) -> Option<u128> {
4040
if let ExprKind::Lit(lit) = expr.kind
@@ -46,7 +46,7 @@ fn expr_as_u128(expr: &Expr<'_>) -> Option<u128> {
4646
}
4747
}
4848

49-
impl LateLintPass<'_> for ManualRangePattern {
49+
impl LateLintPass<'_> for ManualRangePatterns {
5050
fn check_pat(&mut self, cx: &LateContext<'_>, pat: &'_ rustc_hir::Pat<'_>) {
5151
if in_external_macro(cx.sess(), pat.span) {
5252
return;
@@ -110,7 +110,7 @@ impl LateLintPass<'_> for ManualRangePattern {
110110
if contains_whole_range {
111111
span_lint_and_sugg(
112112
cx,
113-
MANUAL_RANGE_PATTERN,
113+
MANUAL_RANGE_PATTERNS,
114114
pat.span,
115115
"this OR pattern can be rewritten using a range",
116116
"try",

tests/ui/manual_range_pattern.fixed renamed to tests/ui/manual_range_patterns.fixed

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
//@run-rustfix
22

33
#![allow(unused)]
4-
#![warn(clippy::manual_range_pattern)]
4+
#![warn(clippy::manual_range_patterns)]
55
#![feature(exclusive_range_pattern)]
66

77
fn main() {

tests/ui/manual_range_pattern.rs renamed to tests/ui/manual_range_patterns.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
//@run-rustfix
22

33
#![allow(unused)]
4-
#![warn(clippy::manual_range_pattern)]
4+
#![warn(clippy::manual_range_patterns)]
55
#![feature(exclusive_range_pattern)]
66

77
fn main() {

tests/ui/manual_range_pattern.stderr renamed to tests/ui/manual_range_patterns.stderr

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,43 @@
11
error: this OR pattern can be rewritten using a range
2-
--> $DIR/manual_range_pattern.rs:10:25
2+
--> $DIR/manual_range_patterns.rs:10:25
33
|
44
LL | let _ = matches!(f, 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10);
55
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `1..=10`
66
|
7-
= note: `-D clippy::manual-range-pattern` implied by `-D warnings`
7+
= note: `-D clippy::manual-range-patterns` implied by `-D warnings`
88

99
error: this OR pattern can be rewritten using a range
10-
--> $DIR/manual_range_pattern.rs:11:25
10+
--> $DIR/manual_range_patterns.rs:11:25
1111
|
1212
LL | let _ = matches!(f, 4 | 2 | 3 | 1 | 5 | 6 | 9 | 7 | 8 | 10);
1313
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `1..=10`
1414

1515
error: this OR pattern can be rewritten using a range
16-
--> $DIR/manual_range_pattern.rs:20:25
16+
--> $DIR/manual_range_patterns.rs:20:25
1717
|
1818
LL | let _ = matches!(f, (1..=10) | (2..=13) | (14..=48324728) | 48324729);
1919
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `1..=48324729`
2020

2121
error: this OR pattern can be rewritten using a range
22-
--> $DIR/manual_range_pattern.rs:21:25
22+
--> $DIR/manual_range_patterns.rs:21:25
2323
|
2424
LL | let _ = matches!(f, 0 | (1..=10) | 48324730 | (2..=13) | (14..=48324728) | 48324729);
2525
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `0..=48324730`
2626

2727
error: this OR pattern can be rewritten using a range
28-
--> $DIR/manual_range_pattern.rs:22:25
28+
--> $DIR/manual_range_patterns.rs:22:25
2929
|
3030
LL | let _ = matches!(f, 0..=1 | 0..=2 | 0..=3);
3131
| ^^^^^^^^^^^^^^^^^^^^^ help: try: `0..=3`
3232

3333
error: this OR pattern can be rewritten using a range
34-
--> $DIR/manual_range_pattern.rs:25:9
34+
--> $DIR/manual_range_patterns.rs:25:9
3535
|
3636
LL | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 => true,
3737
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `1..=10`
3838

3939
error: this OR pattern can be rewritten using a range
40-
--> $DIR/manual_range_pattern.rs:31:26
40+
--> $DIR/manual_range_patterns.rs:31:26
4141
|
4242
LL | matches!($e, 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10)
4343
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `1..=10`

tests/ui/unnested_or_patterns.fixed

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
clippy::match_ref_pats,
88
clippy::upper_case_acronyms,
99
clippy::needless_if,
10-
clippy::manual_range_pattern
10+
clippy::manual_range_patterns
1111
)]
1212
#![allow(unreachable_patterns, irrefutable_let_patterns, unused)]
1313

tests/ui/unnested_or_patterns.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
clippy::match_ref_pats,
88
clippy::upper_case_acronyms,
99
clippy::needless_if,
10-
clippy::manual_range_pattern
10+
clippy::manual_range_patterns
1111
)]
1212
#![allow(unreachable_patterns, irrefutable_let_patterns, unused)]
1313

tests/ui/unnested_or_patterns2.fixed

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
clippy::cognitive_complexity,
77
clippy::match_ref_pats,
88
clippy::needless_if,
9-
clippy::manual_range_pattern
9+
clippy::manual_range_patterns
1010
)]
1111
#![allow(unreachable_patterns, irrefutable_let_patterns, unused_variables)]
1212

tests/ui/unnested_or_patterns2.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
clippy::cognitive_complexity,
77
clippy::match_ref_pats,
88
clippy::needless_if,
9-
clippy::manual_range_pattern
9+
clippy::manual_range_patterns
1010
)]
1111
#![allow(unreachable_patterns, irrefutable_let_patterns, unused_variables)]
1212

0 commit comments

Comments
 (0)