Skip to content

Commit 8ba377a

Browse files
committed
Fix names to use plural
1 parent bf7a786 commit 8ba377a

11 files changed

+55
-55
lines changed

clippy_lints/src/lib.register_all.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,7 @@ store.register_group(true, "clippy::all", Some("clippy_all"), vec![
242242
LintId::of(needless_bool::NEEDLESS_BOOL),
243243
LintId::of(needless_borrowed_ref::NEEDLESS_BORROWED_REFERENCE),
244244
LintId::of(needless_late_init::NEEDLESS_LATE_INIT),
245-
LintId::of(needless_parens_on_range_literal::NEEDLESS_PARENS_ON_RANGE_LITERAL),
245+
LintId::of(needless_parens_on_range_literals::NEEDLESS_PARENS_ON_RANGE_LITERALS),
246246
LintId::of(needless_question_mark::NEEDLESS_QUESTION_MARK),
247247
LintId::of(needless_update::NEEDLESS_UPDATE),
248248
LintId::of(neg_cmp_op_on_partial_ord::NEG_CMP_OP_ON_PARTIAL_ORD),

clippy_lints/src/lib.register_lints.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -408,7 +408,7 @@ store.register_lints(&[
408408
needless_continue::NEEDLESS_CONTINUE,
409409
needless_for_each::NEEDLESS_FOR_EACH,
410410
needless_late_init::NEEDLESS_LATE_INIT,
411-
needless_parens_on_range_literal::NEEDLESS_PARENS_ON_RANGE_LITERAL,
411+
needless_parens_on_range_literals::NEEDLESS_PARENS_ON_RANGE_LITERALS,
412412
needless_pass_by_value::NEEDLESS_PASS_BY_VALUE,
413413
needless_question_mark::NEEDLESS_QUESTION_MARK,
414414
needless_update::NEEDLESS_UPDATE,

clippy_lints/src/lib.register_style.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ store.register_group(true, "clippy::style", Some("clippy_style"), vec![
9191
LintId::of(mut_mutex_lock::MUT_MUTEX_LOCK),
9292
LintId::of(mut_reference::UNNECESSARY_MUT_PASSED),
9393
LintId::of(needless_late_init::NEEDLESS_LATE_INIT),
94-
LintId::of(needless_parens_on_range_literal::NEEDLESS_PARENS_ON_RANGE_LITERAL),
94+
LintId::of(needless_parens_on_range_literals::NEEDLESS_PARENS_ON_RANGE_LITERALS),
9595
LintId::of(neg_multiply::NEG_MULTIPLY),
9696
LintId::of(new_without_default::NEW_WITHOUT_DEFAULT),
9797
LintId::of(non_copy_const::BORROW_INTERIOR_MUTABLE_CONST),

clippy_lints/src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -315,7 +315,7 @@ mod needless_borrowed_ref;
315315
mod needless_continue;
316316
mod needless_for_each;
317317
mod needless_late_init;
318-
mod needless_parens_on_range_literal;
318+
mod needless_parens_on_range_literals;
319319
mod needless_pass_by_value;
320320
mod needless_question_mark;
321321
mod needless_update;
@@ -747,7 +747,7 @@ pub fn register_plugins(store: &mut rustc_lint::LintStore, sess: &Session, conf:
747747
store.register_early_pass(|| Box::new(collapsible_if::CollapsibleIf));
748748
store.register_early_pass(|| Box::new(items_after_statements::ItemsAfterStatements));
749749
store.register_early_pass(|| Box::new(precedence::Precedence));
750-
store.register_late_pass(|| Box::new(needless_parens_on_range_literal::NeedlessParensOnRangeLiteral));
750+
store.register_late_pass(|| Box::new(needless_parens_on_range_literals::NeedlessParensOnRangeLiterals));
751751
store.register_early_pass(|| Box::new(needless_continue::NeedlessContinue));
752752
store.register_early_pass(|| Box::new(redundant_else::RedundantElse));
753753
store.register_late_pass(|| Box::new(create_dir::CreateDir));

clippy_lints/src/needless_parens_on_range_literal.rs renamed to clippy_lints/src/needless_parens_on_range_literals.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -36,12 +36,12 @@ declare_clippy_lint! {
3636
/// }
3737
/// ```
3838
#[clippy::version = "1.63.0"]
39-
pub NEEDLESS_PARENS_ON_RANGE_LITERAL,
39+
pub NEEDLESS_PARENS_ON_RANGE_LITERALS,
4040
style,
41-
"needless parenthesis on range literal can be removed"
41+
"needless parenthesis on range literals can be removed"
4242
}
4343

44-
declare_lint_pass!(NeedlessParensOnRangeLiteral => [NEEDLESS_PARENS_ON_RANGE_LITERAL]);
44+
declare_lint_pass!(NeedlessParensOnRangeLiterals => [NEEDLESS_PARENS_ON_RANGE_LITERALS]);
4545

4646
fn snippet_enclosed_in_parenthesis(snippet: &str) -> bool {
4747
snippet.starts_with('(') && snippet.ends_with(')')
@@ -63,8 +63,8 @@ fn check_for_parens(cx: &LateContext<'_>, e: &Expr<'_>, is_start: bool) {
6363
if snippet_enclosed_in_parenthesis(&snippet(cx, e.span, ""));
6464
then {
6565
let mut applicability = Applicability::MachineApplicable;
66-
span_lint_and_then(cx, NEEDLESS_PARENS_ON_RANGE_LITERAL, e.span,
67-
"needless parenthesis on range literal can be removed",
66+
span_lint_and_then(cx, NEEDLESS_PARENS_ON_RANGE_LITERALS, e.span,
67+
"needless parenthesis on range literals can be removed",
6868
|diag| {
6969
let suggestion = snippet_with_applicability(cx, literal.span, "_", &mut applicability);
7070
diag.span_suggestion(e.span, "try", suggestion, applicability);
@@ -73,7 +73,7 @@ fn check_for_parens(cx: &LateContext<'_>, e: &Expr<'_>, is_start: bool) {
7373
}
7474
}
7575

76-
impl<'tcx> LateLintPass<'tcx> for NeedlessParensOnRangeLiteral {
76+
impl<'tcx> LateLintPass<'tcx> for NeedlessParensOnRangeLiterals {
7777
fn check_expr(&mut self, cx: &LateContext<'tcx>, expr: &'tcx Expr<'_>) {
7878
if let Some(higher::Range { start, end, .. }) = higher::Range::hir(expr) {
7979
if let Some(start) = start {

tests/ui/almost_complete_letter_range.fixed

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
#![feature(stmt_expr_attributes)]
77
#![warn(clippy::almost_complete_letter_range)]
88
#![allow(ellipsis_inclusive_range_patterns)]
9-
#![allow(clippy::needless_parens_on_range_literal)]
9+
#![allow(clippy::needless_parens_on_range_literals)]
1010

1111
macro_rules! a {
1212
() => {

tests/ui/almost_complete_letter_range.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
#![feature(stmt_expr_attributes)]
77
#![warn(clippy::almost_complete_letter_range)]
88
#![allow(ellipsis_inclusive_range_patterns)]
9-
#![allow(clippy::needless_parens_on_range_literal)]
9+
#![allow(clippy::needless_parens_on_range_literals)]
1010

1111
macro_rules! a {
1212
() => {

tests/ui/needless_parens_on_range_literal.stderr

Lines changed: 0 additions & 40 deletions
This file was deleted.

tests/ui/needless_parens_on_range_literal.fixed renamed to tests/ui/needless_parens_on_range_literals.fixed

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

4-
#![warn(clippy::needless_parens_on_range_literal)]
4+
#![warn(clippy::needless_parens_on_range_literals)]
55
#![allow(clippy::almost_complete_letter_range)]
66

77
fn main() {

tests/ui/needless_parens_on_range_literal.rs renamed to tests/ui/needless_parens_on_range_literals.rs

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

4-
#![warn(clippy::needless_parens_on_range_literal)]
4+
#![warn(clippy::needless_parens_on_range_literals)]
55
#![allow(clippy::almost_complete_letter_range)]
66

77
fn main() {
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
error: needless parenthesis on range literals can be removed
2+
--> $DIR/needless_parens_on_range_literals.rs:8:13
3+
|
4+
LL | let _ = ('a')..=('z');
5+
| ^^^^^ help: try: `'a'`
6+
|
7+
= note: `-D clippy::needless-parens-on-range-literals` implied by `-D warnings`
8+
9+
error: needless parenthesis on range literals can be removed
10+
--> $DIR/needless_parens_on_range_literals.rs:8:21
11+
|
12+
LL | let _ = ('a')..=('z');
13+
| ^^^^^ help: try: `'z'`
14+
15+
error: needless parenthesis on range literals can be removed
16+
--> $DIR/needless_parens_on_range_literals.rs:9:18
17+
|
18+
LL | let _ = 'a'..('z');
19+
| ^^^^^ help: try: `'z'`
20+
21+
error: needless parenthesis on range literals can be removed
22+
--> $DIR/needless_parens_on_range_literals.rs:11:19
23+
|
24+
LL | let _ = (1.)..(2.);
25+
| ^^^^ help: try: `2.`
26+
27+
error: needless parenthesis on range literals can be removed
28+
--> $DIR/needless_parens_on_range_literals.rs:12:13
29+
|
30+
LL | let _ = ('a')..;
31+
| ^^^^^ help: try: `'a'`
32+
33+
error: needless parenthesis on range literals can be removed
34+
--> $DIR/needless_parens_on_range_literals.rs:13:15
35+
|
36+
LL | let _ = ..('z');
37+
| ^^^^^ help: try: `'z'`
38+
39+
error: aborting due to 6 previous errors
40+

0 commit comments

Comments
 (0)