]> git.lizzy.rs Git - rust.git/blob - src/tools/clippy/src/docs/redundant_closure_call.txt
Rollup merge of #101389 - lukaslueg:rcgetmutdocs, r=m-ou-se
[rust.git] / src / tools / clippy / src / docs / redundant_closure_call.txt
1 ### What it does
2 Detects closures called in the same expression where they
3 are defined.
4
5 ### Why is this bad?
6 It is unnecessarily adding to the expression's
7 complexity.
8
9 ### Example
10 ```
11 let a = (|| 42)();
12 ```
13
14 Use instead:
15 ```
16 let a = 42;
17 ```