Closed
Description
Functions that exhaust iterators should take them by value, even if they don't require ownership.
Example:
foo.extend(&mut bar.move_iter());
-> foo.extend(bar.move_iter());
This optimizes the ergonomy of using them for the common case where you don't need access to the iterator anymore after it is empty, while still retaining the ability to do so with the by_ref()
adapter:
let mut iter = bar.move_iter();
foo.extend(iter.by_ref());
iter.baz();
Metadata
Metadata
Assignees
Labels
No labels