8

Github `while_let_on_iterator` Improvements by Jarcho · Pull Request #6966 · rus...

 3 years ago
source link: https://github.com/rust-lang/rust-clippy/pull/6966
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

Copy link

Contributor

Jarcho commented on Mar 24

fixes: #6491
fixes: #6231
fixes: #5844
fixes: #1924
fixes: #1033

The check for whether a field can be borrowed should probably be moved to utils at some point, but it would require some cleanup work and knowing what parts can actually be shared.

changelog: Suggest &mut iter when the iterator is used after the loop.
changelog: Suggest &mut iter when the iterator is a field in a struct.
changelog: Don't lint when the iterator is a field in a struct, and the struct is used in the loop.
changelog: Lint when the loop is nested in another loop, but suggest &mut iter unless the iterator is from a local declared inside the loop.


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK