restore Vec::extend specialization for vec::IntoIter sources that
was lost during refactoring
This commit is contained in:
parent
07a8c1b95a
commit
631543dcb4
1 changed files with 9 additions and 0 deletions
|
@ -2297,6 +2297,15 @@ where
|
|||
}
|
||||
}
|
||||
|
||||
impl<T> SpecExtend<T, IntoIter<T>> for Vec<T> {
|
||||
fn spec_extend(&mut self, mut iterator: IntoIter<T>) {
|
||||
unsafe {
|
||||
self.append_elements(iterator.as_slice() as _);
|
||||
}
|
||||
iterator.ptr = iterator.end;
|
||||
}
|
||||
}
|
||||
|
||||
impl<'a, T: 'a, I> SpecExtend<&'a T, I> for Vec<T>
|
||||
where
|
||||
I: Iterator<Item = &'a T>,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue