-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
suggest iterator.count() instead of iterator.collect<Vec<_>>.len() #3034
Comments
+1, this should always be safe if |
I'll go ahead and pick this up. |
shssoichiro
added a commit
to shssoichiro/rust-clippy
that referenced
this issue
Aug 31, 2018
Handles cases of `.collect().len()`, `.collect().is_empty()`, and `.collect().contains()`. This lint is intended to be generic enough to be added to at a later time with other similar patterns that could be optimized. Closes rust-lang#3034
shssoichiro
added a commit
to shssoichiro/rust-clippy
that referenced
this issue
Aug 31, 2018
Handles cases of `.collect().len()`, `.collect().is_empty()`, and `.collect().contains()`. This lint is intended to be generic enough to be added to at a later time with other similar patterns that could be optimized. Closes rust-lang#3034
shssoichiro
added a commit
to shssoichiro/rust-clippy
that referenced
this issue
Sep 4, 2018
Handles cases of `.collect().len()`, `.collect().is_empty()`, and `.collect().contains()`. This lint is intended to be generic enough to be added to at a later time with other similar patterns that could be optimized. Closes rust-lang#3034
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
instead of doing something like
we might want to suggest
however,
.count()
consumes the iterator so I am not sure if this is always applicable.The text was updated successfully, but these errors were encountered: