Closed
Description
I wanted to move out a number of front element from a vector, like my_vec.drain(..x)
but I wonder if this is the right way to do this cause doc is unclear, note 1 and note 2 say the opposite each other:
Creates a draining iterator that removes the specified range in the vector and yields the removed items.
Note 1: The element range is removed even if the iterator is only partially consumed or not consumed at all.
Note 2: It is unspecified how many elements are removed from the vector if the Drain value is leaked.
https://doc.rust-lang.org/std/vec/struct.Vec.html#method.drain
This issue has been assigned to @poliorcetics via this comment.