Skip to content

Commit 18f8a05

Browse files
committed
make lint name plural
required by the naming guidelines
1 parent e6a81b2 commit 18f8a05

File tree

7 files changed

+28
-28
lines changed

7 files changed

+28
-28
lines changed

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5836,7 +5836,7 @@ Released 2018-09-13
58365836
[`drop_copy`]: https://rust-lang.github.io/rust-clippy/master/index.html#drop_copy
58375837
[`drop_non_drop`]: https://rust-lang.github.io/rust-clippy/master/index.html#drop_non_drop
58385838
[`drop_ref`]: https://rust-lang.github.io/rust-clippy/master/index.html#drop_ref
5839-
[`duplicate_match_guard`]: https://rust-lang.github.io/rust-clippy/master/index.html#duplicate_match_guard
5839+
[`duplicate_match_guards`]: https://rust-lang.github.io/rust-clippy/master/index.html#duplicate_match_guards
58405840
[`duplicate_mod`]: https://rust-lang.github.io/rust-clippy/master/index.html#duplicate_mod
58415841
[`duplicate_underscore_argument`]: https://rust-lang.github.io/rust-clippy/master/index.html#duplicate_underscore_argument
58425842
[`duplicated_attributes`]: https://rust-lang.github.io/rust-clippy/master/index.html#duplicated_attributes

clippy_lints/src/declared_lints.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ pub static LINTS: &[&::declare_clippy_lint::LintInfo] = &[
135135
crate::drop_forget_ref::DROP_NON_DROP_INFO,
136136
crate::drop_forget_ref::FORGET_NON_DROP_INFO,
137137
crate::drop_forget_ref::MEM_FORGET_INFO,
138-
crate::duplicate_match_guard::DUPLICATE_MATCH_GUARD_INFO,
138+
crate::duplicate_match_guards::DUPLICATE_MATCH_GUARDS_INFO,
139139
crate::duplicate_mod::DUPLICATE_MOD_INFO,
140140
crate::else_if_without_else::ELSE_IF_WITHOUT_ELSE_INFO,
141141
crate::empty_drop::EMPTY_DROP_INFO,

clippy_lints/src/duplicate_match_guard.rs renamed to clippy_lints/src/duplicate_match_guards.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -45,13 +45,13 @@ declare_clippy_lint! {
4545
/// }
4646
/// ```
4747
#[clippy::version = "1.89.0"]
48-
pub DUPLICATE_MATCH_GUARD,
48+
pub DUPLICATE_MATCH_GUARDS,
4949
nursery,
5050
"a condition in match body duplicating the match guard"
5151
}
52-
declare_lint_pass!(DuplicateMatchGuard => [DUPLICATE_MATCH_GUARD]);
52+
declare_lint_pass!(DuplicateMatchGuards => [DUPLICATE_MATCH_GUARDS]);
5353

54-
impl<'tcx> LateLintPass<'tcx> for DuplicateMatchGuard {
54+
impl<'tcx> LateLintPass<'tcx> for DuplicateMatchGuards {
5555
fn check_arm(&mut self, cx: &LateContext<'tcx>, arm: &'tcx Arm<'tcx>) {
5656
let Some(guard) = arm.guard else {
5757
return;
@@ -100,7 +100,7 @@ impl<'tcx> LateLintPass<'tcx> for DuplicateMatchGuard {
100100
// since the arm body already has braces
101101
span_lint_and_then(
102102
cx,
103-
DUPLICATE_MATCH_GUARD,
103+
DUPLICATE_MATCH_GUARDS,
104104
arm_body_expr.span,
105105
"condition duplicates match guard",
106106
|diag| {
@@ -123,7 +123,7 @@ impl<'tcx> LateLintPass<'tcx> for DuplicateMatchGuard {
123123
// since there are no outer braces coming from the arm body
124124
span_lint_and_sugg(
125125
cx,
126-
DUPLICATE_MATCH_GUARD,
126+
DUPLICATE_MATCH_GUARDS,
127127
arm_body_expr.span,
128128
"condition duplicates match guard",
129129
"remove the condition",

clippy_lints/src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ mod disallowed_types;
121121
mod doc;
122122
mod double_parens;
123123
mod drop_forget_ref;
124-
mod duplicate_match_guard;
124+
mod duplicate_match_guards;
125125
mod duplicate_mod;
126126
mod else_if_without_else;
127127
mod empty_drop;
@@ -831,6 +831,6 @@ pub fn register_lint_passes(store: &mut rustc_lint::LintStore, conf: &'static Co
831831
store.register_late_pass(|_| Box::new(cloned_ref_to_slice_refs::ClonedRefToSliceRefs::new(conf)));
832832
store.register_late_pass(|_| Box::new(infallible_try_from::InfallibleTryFrom));
833833
store.register_late_pass(|_| Box::new(coerce_container_to_any::CoerceContainerToAny));
834-
store.register_late_pass(|_| Box::new(duplicate_match_guard::DuplicateMatchGuard));
834+
store.register_late_pass(|_| Box::new(duplicate_match_guards::DuplicateMatchGuards));
835835
// add lints here, do not remove this comment, it's used in `new_lint`
836836
}

tests/ui/duplicate_match_guard.fixed renamed to tests/ui/duplicate_match_guards.fixed

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#![allow(clippy::needless_return, clippy::needless_else)]
2-
#![warn(clippy::duplicate_match_guard)]
2+
#![warn(clippy::duplicate_match_guards)]
33

44
fn main() {
55
let mut a = 5;
@@ -9,34 +9,34 @@ fn main() {
99
match 0u32 {
1010
0 if true => {
1111
{
12-
//~^ duplicate_match_guard
12+
//~^ duplicate_match_guards
1313
return;
1414
}
1515
},
1616
0 if a > b => {
1717
{
18-
//~^ duplicate_match_guard
18+
//~^ duplicate_match_guards
1919
return;
2020
}
2121
},
2222
// not _identical_, but the meaning is the same
2323
0 if a > b => {
2424
{
25-
//~^ duplicate_match_guard
25+
//~^ duplicate_match_guards
2626
return;
2727
}
2828
},
2929
// a bit more complicated
3030
0 if a > 0 && b > 0 => {
3131
{
32-
//~^ duplicate_match_guard
32+
//~^ duplicate_match_guards
3333
return;
3434
}
3535
},
3636
// no curlies around arm body
3737
#[rustfmt::skip] // would add the outer curlies
3838
0 if true => {
39-
//~^ duplicate_match_guard
39+
//~^ duplicate_match_guards
4040
return;
4141
},
4242

tests/ui/duplicate_match_guard.rs renamed to tests/ui/duplicate_match_guards.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#![allow(clippy::needless_return, clippy::needless_else)]
2-
#![warn(clippy::duplicate_match_guard)]
2+
#![warn(clippy::duplicate_match_guards)]
33

44
fn main() {
55
let mut a = 5;
@@ -9,34 +9,34 @@ fn main() {
99
match 0u32 {
1010
0 if true => {
1111
if true {
12-
//~^ duplicate_match_guard
12+
//~^ duplicate_match_guards
1313
return;
1414
}
1515
},
1616
0 if a > b => {
1717
if a > b {
18-
//~^ duplicate_match_guard
18+
//~^ duplicate_match_guards
1919
return;
2020
}
2121
},
2222
// not _identical_, but the meaning is the same
2323
0 if a > b => {
2424
if b < a {
25-
//~^ duplicate_match_guard
25+
//~^ duplicate_match_guards
2626
return;
2727
}
2828
},
2929
// a bit more complicated
3030
0 if a > 0 && b > 0 => {
3131
if a > 0 && b > 0 {
32-
//~^ duplicate_match_guard
32+
//~^ duplicate_match_guards
3333
return;
3434
}
3535
},
3636
// no curlies around arm body
3737
#[rustfmt::skip] // would add the outer curlies
3838
0 if true => if true {
39-
//~^ duplicate_match_guard
39+
//~^ duplicate_match_guards
4040
return;
4141
},
4242

tests/ui/duplicate_match_guard.stderr renamed to tests/ui/duplicate_match_guards.stderr

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
error: condition duplicates match guard
2-
--> tests/ui/duplicate_match_guard.rs:11:13
2+
--> tests/ui/duplicate_match_guards.rs:11:13
33
|
44
LL | / if true {
55
LL | |
66
LL | | return;
77
LL | | }
88
| |_____________^
99
|
10-
= note: `-D clippy::duplicate-match-guard` implied by `-D warnings`
11-
= help: to override `-D warnings` add `#[allow(clippy::duplicate_match_guard)]`
10+
= note: `-D clippy::duplicate-match-guards` implied by `-D warnings`
11+
= help: to override `-D warnings` add `#[allow(clippy::duplicate_match_guards)]`
1212
help: remove the condition
1313
|
1414
LL ~ {
@@ -18,7 +18,7 @@ LL + }
1818
|
1919

2020
error: condition duplicates match guard
21-
--> tests/ui/duplicate_match_guard.rs:17:13
21+
--> tests/ui/duplicate_match_guards.rs:17:13
2222
|
2323
LL | / if a > b {
2424
LL | |
@@ -35,7 +35,7 @@ LL + }
3535
|
3636

3737
error: condition duplicates match guard
38-
--> tests/ui/duplicate_match_guard.rs:24:13
38+
--> tests/ui/duplicate_match_guards.rs:24:13
3939
|
4040
LL | / if b < a {
4141
LL | |
@@ -52,7 +52,7 @@ LL + }
5252
|
5353

5454
error: condition duplicates match guard
55-
--> tests/ui/duplicate_match_guard.rs:31:13
55+
--> tests/ui/duplicate_match_guards.rs:31:13
5656
|
5757
LL | / if a > 0 && b > 0 {
5858
LL | |
@@ -69,7 +69,7 @@ LL + }
6969
|
7070

7171
error: condition duplicates match guard
72-
--> tests/ui/duplicate_match_guard.rs:38:22
72+
--> tests/ui/duplicate_match_guards.rs:38:22
7373
|
7474
LL | 0 if true => if true {
7575
| ______________________^

0 commit comments

Comments
 (0)