summaryrefslogtreecommitdiffstats
path: root/src/tools/clippy/src/docs/redundant_closure_for_method_calls.txt
blob: 865510e14755a0c7b29c00711ea47dbd38534c86 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
### 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);
```