too-many-lists
too-many-lists copied to clipboard
Mention iterating twice in second implementation
If I were to implement tests for list in any most other languages, I consider that I would check that iteration don't change the list, that we can iterate twice on it. I suggest that it makes sense to add a small discussion about this topic, explaining why it can't be done with into_iter, the tradeoff between next giving ownership and keeping ownership of list.
I'd also consider creating a variable out of the result of next and using it in the second iteration of the test. That would show that creating an iterator while holding a reference to the result of next is possible with iter but not with mut_iter.
However, I am less certain that it is relevant than this PR, so I'll wait until you give your opinion to potentially write it if you're interested