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

lint iterator.map(|x| x) #5626

Closed
matthiaskrgr opened this issue May 20, 2020 · 4 comments
Closed

lint iterator.map(|x| x) #5626

matthiaskrgr opened this issue May 20, 2020 · 4 comments
Labels
A-lint Area: New lints good-first-issue These issues are a good way to get started with Clippy

Comments

@matthiaskrgr
Copy link
Member

matthiaskrgr commented May 20, 2020

This was most likely left over after some refactoring and can be removed entirely (at least I can't think of a reason to have .map(|x| x) in the code right now..)

@matthiaskrgr matthiaskrgr added the A-lint Area: New lints label May 20, 2020
@matthiaskrgr matthiaskrgr changed the title lint .map(|x| x) lint iterator.map(|x| x) May 20, 2020
@flip1995 flip1995 added the good-first-issue These issues are a good way to get started with Clippy label May 21, 2020
@llogiq
Copy link
Contributor

llogiq commented May 26, 2020

Note that this will apply type adjustments on x where applicable. However, the redundant_closure lint already has a check for adjustments which can be copied to this new lint.

@theo-lw
Copy link
Contributor

theo-lw commented May 30, 2020

I'd like to try my hand at this!

bors added a commit that referenced this issue Jun 23, 2020
#5626: lint iterator.map(|x| x)

changelog: adds a new lint for iterator.map(|x| x) (see #5626)

The code also lints for result.map(|x| x) and option.map(|x| x). Also, I'm not sure if I'm checking for type adjustments correctly and I can't think of an example where .map(|x| x) would apply type adjustments.
bors added a commit that referenced this issue Jun 23, 2020
#5626: lint iterator.map(|x| x)

changelog: adds a new lint for iterator.map(|x| x) (see #5626)

The code also lints for result.map(|x| x) and option.map(|x| x). Also, I'm not sure if I'm checking for type adjustments correctly and I can't think of an example where .map(|x| x) would apply type adjustments.
@giraffate
Copy link
Contributor

Hi, is this issue already resolved? If so, it would be better to close this.

@JohnTitor
Copy link
Member

Closing in favor of #5694.

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
Projects
None yet
Development

No branches or pull requests

6 participants