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

Improvement Idea: the ilter_next should also cover skip_while().next() #4036

Closed
Lesstat opened this issue Apr 27, 2019 · 0 comments · Fixed by #5067
Closed

Improvement Idea: the ilter_next should also cover skip_while().next() #4036

Lesstat opened this issue Apr 27, 2019 · 0 comments · Fixed by #5067
Labels
C-enhancement Category: Enhancement of lints, like adding more cases or adding help messages L-complexity Lint: Belongs in the complexity lint group

Comments

@Lesstat
Copy link

Lesstat commented Apr 27, 2019

I recently realized that skip_while(|i| !condition(i)).next() does the same as filter(|i| condition(i)).next() and more importantly has the same intent.

I propose to also lint skip_while(...).next()with the filter_next lint.

@flip1995 flip1995 added L-complexity Lint: Belongs in the complexity lint group C-enhancement Category: Enhancement of lints, like adding more cases or adding help messages labels Apr 27, 2019
@bors bors closed this as completed in eca0d8e Jan 20, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-enhancement Category: Enhancement of lints, like adding more cases or adding help messages L-complexity Lint: Belongs in the complexity lint group
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants