mirror of
https://github.com/rust-lang/rust-clippy
synced 2024-11-24 05:33:27 +00:00
5b60388e5a
[`redundant_closure_call`]: handle nested closures Fixes #9956. This ended up being a much larger change than I'd thought, and I ended up having to pretty much rewrite it as a late lint pass, because it needs access to certain things that I don't think are available in early lint passes (e.g. getting the parent expr). I think this'll be required to fi-x #10922 anyway, so this is probably fine. (edit: had to write "fi-x" because "fix" makes github think that this PR fixes it, which it doesn't 😅 ) Previously, it would suggest changing `(|| || 42)()()` to `|| 42()`, which is a type error (it needs parens: `(|| 42)()`). In my opinion, though, the suggested fix should have really been `42`, so that's what this PR changes. changelog: [`redundant_closure_call`]: handle nested closures and rewrite as a late lint pass |
||
---|---|---|
.. | ||
src | ||
Cargo.toml | ||
README.md |