1
Fork 0

add a note to Vec's Extend<&T> impl about its slice specialization

This commit is contained in:
QuietMisdreavus 2017-07-24 10:16:16 -05:00
parent 5669c9988f
commit 6e36769d29

View file

@ -1962,6 +1962,12 @@ impl<T> Vec<T> {
}
/// Extend implementation that copies elements out of references before pushing them onto the Vec.
///
/// This implementation is specialized for slice iterators, where it uses [`copy_from_slice`] to
/// append the entire slice at once.
///
/// [`copy_from_slice`]: ../../std/primitive.slice.html#method.copy_from_slice
#[stable(feature = "extend_ref", since = "1.2.0")]
impl<'a, T: 'a + Copy> Extend<&'a T> for Vec<T> {
fn extend<I: IntoIterator<Item = &'a T>>(&mut self, iter: I) {