diff options
Diffstat (limited to '')
-rw-r--r-- | src/tools/clippy/src/docs/redundant_closure.txt | 25 |
1 files changed, 0 insertions, 25 deletions
diff --git a/src/tools/clippy/src/docs/redundant_closure.txt b/src/tools/clippy/src/docs/redundant_closure.txt deleted file mode 100644 index 0faa9513f..000000000 --- a/src/tools/clippy/src/docs/redundant_closure.txt +++ /dev/null @@ -1,25 +0,0 @@ -### What it does -Checks for closures which just call another function where -the function can be called directly. `unsafe` functions or calls where types -get adjusted are ignored. - -### Why is this bad? -Needlessly creating a closure adds code for no benefit -and gives the optimizer more work. - -### Known problems -If creating the closure inside the closure has a side- -effect then moving the closure creation out will change when that side- -effect runs. -See [#1439](https://github.com/rust-lang/rust-clippy/issues/1439) for more details. - -### Example -``` -xs.map(|x| foo(x)) -``` - -Use instead: -``` -// where `foo(_)` is a plain function that takes the exact argument type of `x`. -xs.map(foo) -```
\ No newline at end of file |