diff options
Diffstat (limited to '')
-rw-r--r-- | src/tools/clippy/src/docs/redundant_closure_for_method_calls.txt | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/tools/clippy/src/docs/redundant_closure_for_method_calls.txt b/src/tools/clippy/src/docs/redundant_closure_for_method_calls.txt new file mode 100644 index 000000000..865510e14 --- /dev/null +++ b/src/tools/clippy/src/docs/redundant_closure_for_method_calls.txt @@ -0,0 +1,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); +```
\ No newline at end of file |