Closed
Description
Description
The top of https://rust-lang.github.io/rust-clippy/master/index.html#/into_iter_without_iter refers to (&val).iter()
whereas (&val).into_iter()
is the one that makes sense in context. If val.iter()
does not compile, then normally neither would (&val).iter()
, so that is not a thing that a user would be forced to write instead of val.iter()
.
Why is this bad?
It’s not bad, but having them is idiomatic and allows the type to be used in iterator chains by just calling.iter()
, instead of the more awkward<&Type>::into_iter
or(&val).iter()
syntax in case of ambiguity with anotherIntoiterator
impl.
Separately, Intoiterator
should be capitalized as IntoIterator
.
Version
No response
Additional Labels
@rustbot label +A-documentation