Skip to content

Lint .flat_map(|x| x) into .flatten() #4224

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

Closed
LunaBorowska opened this issue Jun 21, 2019 · 1 comment · Fixed by #4231
Closed

Lint .flat_map(|x| x) into .flatten() #4224

LunaBorowska opened this issue Jun 21, 2019 · 1 comment · Fixed by #4231
Labels
A-lint Area: New lints good first issue These issues are a good way to get started with Clippy L-complexity Lint: Belongs in the complexity lint group L-suggestion Lint: Improving, adding or fixing lint suggestions

Comments

@LunaBorowska
Copy link
Contributor

LunaBorowska commented Jun 21, 2019

Clippy should suggest using .flatten() instead of .flat_map(|x| x).

@flip1995 flip1995 added L-complexity Lint: Belongs in the complexity lint group L-suggestion Lint: Improving, adding or fixing lint suggestions good first issue These issues are a good way to get started with Clippy A-lint Area: New lints labels Jun 21, 2019
@lopopolo
Copy link

.flat_map(std::convert::identity) too 😄

bors added a commit that referenced this issue Aug 14, 2019
Implement flat_map lint

Fixes #4224

changelog: New Lint `flat_map_identity` to detect unnecessary calls to `flat_map`
bors added a commit that referenced this issue Aug 14, 2019
Implement flat_map lint

Fixes #4224

changelog: New Lint `flat_map_identity` to detect unnecessary calls to `flat_map`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-lint Area: New lints good first issue These issues are a good way to get started with Clippy L-complexity Lint: Belongs in the complexity lint group L-suggestion Lint: Improving, adding or fixing lint suggestions
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants