summaryrefslogtreecommitdiffstats
path: root/src/tools/clippy/src/docs/redundant_closure_call.txt
blob: 913d1a705e294d361f84c5392d49cf256e9acb7d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
### What it does
Detects closures called in the same expression where they
are defined.

### Why is this bad?
It is unnecessarily adding to the expression's
complexity.

### Example
```
let a = (|| 42)();
```

Use instead:
```
let a = 42;
```