Skip to content

Commit

Permalink
add comment for IntoIter::move_to
Browse files Browse the repository at this point in the history
Co-authored-by: Ivan Tham <pickfire@riseup.net>
  • Loading branch information
the8472 and pickfire committed Oct 4, 2020
1 parent 2409653 commit 8a0a13a
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions library/alloc/src/vec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2956,6 +2956,7 @@ impl<T> IntoIter<T> {
unsafe { Vec::from_raw_parts(iter.buf.as_ptr(), offset as usize + iter.len(), iter.cap) }
}

/// Move remaining elements to the end of `dest`.
fn move_to(mut self, dest: &mut Vec<T>) {
unsafe {
dest.append_elements(self.as_slice() as _);
Expand Down

0 comments on commit 8a0a13a

Please sign in to comment.