Suggest implementing IntoIterator for &'_ T
where T
has iter()
method returning an iterator (or vice versa)
#9736
Labels
A-lint
Area: New lints
What it does
If the trait implementation is missing it suggests adding it by forwarding to the method (can be automated).
If the trait implementation is present but the inherent method is not suggest adding it forwarding to trait implementation.
Same for mutable versions.
Both of these APIs are idiomatic.
Probably should be only triggered for public
T
.Lint Name
impl_iter_into_iterator
Category
style
Advantage
std
and many other crates behave the same&T
tofor
or functions expectingIntoIterator
avoiding typing.iter()
Drawbacks
Example
Could be written as:
The text was updated successfully, but these errors were encountered: