-
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
Clippy suggests using a for-loop instead of while-let, even when the for loop doesn't compile. #1156
Comments
You may need to probably can improve the suggestion, bit tricky though. |
That can fail if |
I am in the latter case: the iterator outlives the loop (and, in some On Aug 9, 2016 12:29 AM, "llogiq" [email protected] wrote:
|
So does |
Not in my case, where the iterator is already a reference. On Aug 9, 2016 2:13 AM, "Manish Goregaokar" [email protected]
|
References are Could you post a snippet of the function? |
Similar to #600 |
In my case I use the iterator in the loop body. On Aug 17, 2016 08:05, "Leonardo Yvens" [email protected] wrote:
|
Clippy suggests using a for loop instead of any
while let
loop over an iterator. But this gives a lifetime error if we don't own the iterator.The text was updated successfully, but these errors were encountered: