RS.CLIPPY.REDUNDANT_CLOSURE_FOR_METHOD_CALLS

Redundant closures for method calls

This checker is a Clippy lint created by The Rust Project Contributors. The documentation shown here is a copy of the original documentation for: redundant_closure_for_method_calls. Copyright ©2025 The Rust Team. All rights reserved.

What it does

Checks for closures which only invoke a method on the closure argument and can be replaced by referencing the method directly.

Why is this bad?

It's unnecessary to create the closure.

Example

Some(\'a\').map(|s| s.to_uppercase());

may be rewritten as

Some(\'a\').map(char::to_uppercase);