Rename to redundant_closure_for_method_calls

This commit is contained in:
Manish Goregaokar 2019-05-16 09:18:15 -07:00
parent 4fcaab3d62
commit 373d270673
3 changed files with 5 additions and 5 deletions

View File

@ -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_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`]: 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_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_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`]: 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 [`redundant_pattern_matching`]: https://rust-lang.github.io/rust-clippy/master/index.html#redundant_pattern_matching

View File

@ -46,12 +46,12 @@ declare_clippy_lint! {
/// ```rust,ignore /// ```rust,ignore
/// Some('a').map(char::to_uppercase); /// Some('a').map(char::to_uppercase);
/// ``` /// ```
pub REDUNDANT_CLOSURES_FOR_METHOD_CALLS, pub REDUNDANT_CLOSURE_FOR_METHOD_CALLS,
pedantic, pedantic,
"redundant closures for method calls" "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 { impl<'a, 'tcx> LateLintPass<'a, 'tcx> for EtaReduction {
fn check_expr(&mut self, cx: &LateContext<'a, 'tcx>, expr: &'tcx Expr) { 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]); if let Some(name) = get_ufcs_type_name(cx, method_def_id, &args[0]);
then { 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( db.span_suggestion(
expr.span, expr.span,
"remove closure as shown", "remove closure as shown",

View File

@ -614,7 +614,7 @@ pub fn register_plugins(reg: &mut rustc_plugin::Registry<'_>, conf: &Conf) {
enum_glob_use::ENUM_GLOB_USE, enum_glob_use::ENUM_GLOB_USE,
enum_variants::MODULE_NAME_REPETITIONS, enum_variants::MODULE_NAME_REPETITIONS,
enum_variants::PUB_ENUM_VARIANT_NAMES, enum_variants::PUB_ENUM_VARIANT_NAMES,
eta_reduction::REDUNDANT_CLOSURES_FOR_METHOD_CALLS, eta_reduction::REDUNDANT_CLOSURE_FOR_METHOD_CALLS,
functions::TOO_MANY_LINES, functions::TOO_MANY_LINES,
if_not_else::IF_NOT_ELSE, if_not_else::IF_NOT_ELSE,
infinite_iter::MAYBE_INFINITE_ITER, infinite_iter::MAYBE_INFINITE_ITER,