Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add ide-assist for redundant closure clippy lint #17447

Open
joshka opened this issue Jun 18, 2024 · 1 comment
Open

Add ide-assist for redundant closure clippy lint #17447

joshka opened this issue Jun 18, 2024 · 1 comment
Labels
C-feature Category: feature request

Comments

@joshka
Copy link
Contributor

joshka commented Jun 18, 2024

https://rust-lang.github.io/rust-clippy/master/index.html#/redundant_closure

Example:

xs.map(|x| foo(x))

Replace with:

// where `foo(_)` is a plain function that takes the exact argument type of `x`.
xs.map(foo)
@joshka joshka added the C-feature Category: feature request label Jun 18, 2024
@roife
Copy link
Member

roife commented Jun 22, 2024

As a workaround, you can also set rust-analyzer.check.command to clippy, so that r-a will use clippy for flycheck, and you'll be able to directly use auto-fixes from clippy.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-feature Category: feature request
Projects
None yet
Development

No branches or pull requests

2 participants