#008
Feb 10, 2022
8. Drain
Use drain to remove specified range from a vector.
| |
What is the difference to call into_iter which returns T ?
into_iter takes the collection by value and consumes it.
drain borrows mutable reference, and returns a drain iterator of elements. If such iterator is dropped without exhausting it, all elements are dropped.