diff --git a/CHANGELOG.md b/CHANGELOG.md index b22fd876cb38..44787f4f2818 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1035,7 +1035,7 @@ All notable changes to this project will be documented in this file. [`redundant_clone`]: https://rust-lang.github.io/rust-clippy/master/index.html#redundant_clone [`redundant_closure`]: https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure [`redundant_closure_call`]: https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure_call -[`redundant_closures_for_method_calls`]: https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closures_for_method_calls +[`redundant_closure_for_method_calls`]: https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure_for_method_calls [`redundant_field_names`]: https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names [`redundant_pattern`]: https://rust-lang.github.io/rust-clippy/master/index.html#redundant_pattern [`redundant_pattern_matching`]: https://rust-lang.github.io/rust-clippy/master/index.html#redundant_pattern_matching diff --git a/clippy_lints/src/eta_reduction.rs b/clippy_lints/src/eta_reduction.rs index 8334faa6ec6c..b955b0f2aa5e 100644 --- a/clippy_lints/src/eta_reduction.rs +++ b/clippy_lints/src/eta_reduction.rs @@ -46,12 +46,12 @@ declare_clippy_lint! { /// ```rust,ignore /// Some('a').map(char::to_uppercase); /// ``` - pub REDUNDANT_CLOSURES_FOR_METHOD_CALLS, + pub REDUNDANT_CLOSURE_FOR_METHOD_CALLS, pedantic, "redundant closures for method calls" } -declare_lint_pass!(EtaReduction => [REDUNDANT_CLOSURE, REDUNDANT_CLOSURES_FOR_METHOD_CALLS]); +declare_lint_pass!(EtaReduction => [REDUNDANT_CLOSURE, REDUNDANT_CLOSURE_FOR_METHOD_CALLS]); impl<'a, 'tcx> LateLintPass<'a, 'tcx> for EtaReduction { fn check_expr(&mut self, cx: &LateContext<'a, 'tcx>, expr: &'tcx Expr) { @@ -123,7 +123,7 @@ fn check_closure(cx: &LateContext<'_, '_>, expr: &Expr) { if let Some(name) = get_ufcs_type_name(cx, method_def_id, &args[0]); then { - span_lint_and_then(cx, REDUNDANT_CLOSURES_FOR_METHOD_CALLS, expr.span, "redundant closure found", |db| { + span_lint_and_then(cx, REDUNDANT_CLOSURE_FOR_METHOD_CALLS, expr.span, "redundant closure found", |db| { db.span_suggestion( expr.span, "remove closure as shown", diff --git a/clippy_lints/src/lib.rs b/clippy_lints/src/lib.rs index e9c750553199..400abb5a4980 100644 --- a/clippy_lints/src/lib.rs +++ b/clippy_lints/src/lib.rs @@ -614,7 +614,7 @@ pub fn register_plugins(reg: &mut rustc_plugin::Registry<'_>, conf: &Conf) { enum_glob_use::ENUM_GLOB_USE, enum_variants::MODULE_NAME_REPETITIONS, enum_variants::PUB_ENUM_VARIANT_NAMES, - eta_reduction::REDUNDANT_CLOSURES_FOR_METHOD_CALLS, + eta_reduction::REDUNDANT_CLOSURE_FOR_METHOD_CALLS, functions::TOO_MANY_LINES, if_not_else::IF_NOT_ELSE, infinite_iter::MAYBE_INFINITE_ITER,