Skip to content

Commit

Permalink
Rename lint to use plural form
Browse files Browse the repository at this point in the history
  • Loading branch information
bugadani committed Aug 16, 2020
1 parent b175642 commit fc1e07e
Show file tree
Hide file tree
Showing 8 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -1754,7 +1754,7 @@ Released 2018-09-13
[`unnecessary_cast`]: https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast
[`unnecessary_filter_map`]: https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_filter_map
[`unnecessary_fold`]: https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_fold
[`unnecessary_lazy_evaluation`]: https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_lazy_evaluation
[`unnecessary_lazy_evaluations`]: https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_lazy_evaluations
[`unnecessary_mut_passed`]: https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_mut_passed
[`unnecessary_operation`]: https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_operation
[`unnecessary_sort_by`]: https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_sort_by
Expand Down
6 changes: 3 additions & 3 deletions clippy_lints/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -685,7 +685,7 @@ pub fn register_plugins(store: &mut rustc_lint::LintStore, sess: &Session, conf:
&methods::UNINIT_ASSUMED_INIT,
&methods::UNNECESSARY_FILTER_MAP,
&methods::UNNECESSARY_FOLD,
&methods::UNNECESSARY_LAZY_EVALUATION,
&methods::UNNECESSARY_LAZY_EVALUATIONS,
&methods::UNWRAP_USED,
&methods::USELESS_ASREF,
&methods::WRONG_PUB_SELF_CONVENTION,
Expand Down Expand Up @@ -1361,7 +1361,7 @@ pub fn register_plugins(store: &mut rustc_lint::LintStore, sess: &Session, conf:
LintId::of(&methods::UNINIT_ASSUMED_INIT),
LintId::of(&methods::UNNECESSARY_FILTER_MAP),
LintId::of(&methods::UNNECESSARY_FOLD),
LintId::of(&methods::UNNECESSARY_LAZY_EVALUATION),
LintId::of(&methods::UNNECESSARY_LAZY_EVALUATIONS),
LintId::of(&methods::USELESS_ASREF),
LintId::of(&methods::WRONG_SELF_CONVENTION),
LintId::of(&methods::ZST_OFFSET),
Expand Down Expand Up @@ -1542,7 +1542,7 @@ pub fn register_plugins(store: &mut rustc_lint::LintStore, sess: &Session, conf:
LintId::of(&methods::SINGLE_CHAR_PUSH_STR),
LintId::of(&methods::STRING_EXTEND_CHARS),
LintId::of(&methods::UNNECESSARY_FOLD),
LintId::of(&methods::UNNECESSARY_LAZY_EVALUATION),
LintId::of(&methods::UNNECESSARY_LAZY_EVALUATIONS),
LintId::of(&methods::WRONG_SELF_CONVENTION),
LintId::of(&misc::TOPLEVEL_REF_ARG),
LintId::of(&misc::ZERO_PTR),
Expand Down
4 changes: 2 additions & 2 deletions clippy_lints/src/methods/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1361,7 +1361,7 @@ declare_clippy_lint! {
///
/// opt.unwrap_or(42);
/// ```
pub UNNECESSARY_LAZY_EVALUATION,
pub UNNECESSARY_LAZY_EVALUATIONS,
style,
"using unnecessary lazy evaluation, which can be replaced with simpler eager evaluation"
}
Expand Down Expand Up @@ -1415,7 +1415,7 @@ declare_lint_pass!(Methods => [
ZST_OFFSET,
FILETYPE_IS_FILE,
OPTION_AS_REF_DEREF,
UNNECESSARY_LAZY_EVALUATION,
UNNECESSARY_LAZY_EVALUATIONS,
]);

impl<'tcx> LateLintPass<'tcx> for Methods {
Expand Down
4 changes: 2 additions & 2 deletions clippy_lints/src/methods/unnecessary_lazy_eval.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use rustc_errors::Applicability;
use rustc_hir as hir;
use rustc_lint::LateContext;

use super::UNNECESSARY_LAZY_EVALUATION;
use super::UNNECESSARY_LAZY_EVALUATIONS;

// Return true if the expression is an accessor of any of the arguments
fn expr_uses_argument(expr: &hir::Expr<'_>, params: &[hir::Param<'_>]) -> bool {
Expand Down Expand Up @@ -93,7 +93,7 @@ pub(super) fn lint<'tcx>(

span_lint_and_sugg(
cx,
UNNECESSARY_LAZY_EVALUATION,
UNNECESSARY_LAZY_EVALUATIONS,
expr.span,
msg,
&format!("Use `{}` instead", simplify_using),
Expand Down
2 changes: 1 addition & 1 deletion src/lintlist/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2384,7 +2384,7 @@ pub static ref ALL_LINTS: Vec<Lint> = vec![
module: "methods",
},
Lint {
name: "unnecessary_lazy_evaluation",
name: "unnecessary_lazy_evaluations",
group: "style",
desc: "using unnecessary lazy evaluation, which can be replaced with simpler eager evaluation",
deprecation: None,
Expand Down
2 changes: 1 addition & 1 deletion tests/ui/unnecessary_lazy_eval.fixed
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// run-rustfix
#![warn(clippy::unnecessary_lazy_evaluation)]
#![warn(clippy::unnecessary_lazy_evaluations)]
#![allow(clippy::redundant_closure)]
#![allow(clippy::bind_instead_of_map)]

Expand Down
2 changes: 1 addition & 1 deletion tests/ui/unnecessary_lazy_eval.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// run-rustfix
#![warn(clippy::unnecessary_lazy_evaluation)]
#![warn(clippy::unnecessary_lazy_evaluations)]
#![allow(clippy::redundant_closure)]
#![allow(clippy::bind_instead_of_map)]

Expand Down
2 changes: 1 addition & 1 deletion tests/ui/unnecessary_lazy_eval.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ error: unnecessary closure used to substitute value for `Option::None`
LL | let _ = opt.unwrap_or_else(|| 2);
| ^^^^^^^^^^^^^^^^^^^^^^^^ help: Use `unwrap_or` instead: `opt.unwrap_or(2)`
|
= note: `-D clippy::unnecessary-lazy-evaluation` implied by `-D warnings`
= note: `-D clippy::unnecessary-lazy-evaluations` implied by `-D warnings`

error: unnecessary closure used to substitute value for `Option::None`
--> $DIR/unnecessary_lazy_eval.rs:35:13
Expand Down

0 comments on commit fc1e07e

Please sign in to comment.