add a note to Vec's Extend<&T> impl about its slice specialization
This commit is contained in:
parent
5669c9988f
commit
6e36769d29
1 changed files with 6 additions and 0 deletions
|
@ -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")]
|
#[stable(feature = "extend_ref", since = "1.2.0")]
|
||||||
impl<'a, T: 'a + Copy> Extend<&'a T> for Vec<T> {
|
impl<'a, T: 'a + Copy> Extend<&'a T> for Vec<T> {
|
||||||
fn extend<I: IntoIterator<Item = &'a T>>(&mut self, iter: I) {
|
fn extend<I: IntoIterator<Item = &'a T>>(&mut self, iter: I) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue