Rename lint to use plural form

This commit is contained in:
Dániel Buga 2020-08-16 22:16:39 +02:00
parent b175642a85
commit fc1e07e0c1
8 changed files with 12 additions and 12 deletions

View File

@ -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

View File

@ -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,
@ -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),
@ -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),

View File

@ -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"
}
@ -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 {

View File

@ -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 {
@ -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),

View File

@ -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,

View File

@ -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)]

View File

@ -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)]

View File

@ -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