libcollections: Vec<T> + &[T]
This commit is contained in:
parent
65d3a40c07
commit
dbc7e17cce
@ -1273,6 +1273,8 @@ impl<T> AsSlice<T> for Vec<T> {
|
||||
}
|
||||
}
|
||||
|
||||
// NOTE(stage0): Remove impl after a snapshot
|
||||
#[cfg(stage0)]
|
||||
impl<T: Clone, Sized? V: AsSlice<T>> Add<V, Vec<T>> for Vec<T> {
|
||||
#[inline]
|
||||
fn add(&self, rhs: &V) -> Vec<T> {
|
||||
@ -1283,6 +1285,16 @@ impl<T: Clone, Sized? V: AsSlice<T>> Add<V, Vec<T>> for Vec<T> {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
#[cfg(not(stage0))] // NOTE(stage0): Remove impl after a snapshot
|
||||
impl<'a, T: Clone> Add<&'a [T], Vec<T>> for Vec<T> {
|
||||
#[inline]
|
||||
fn add(mut self, rhs: &[T]) -> Vec<T> {
|
||||
self.push_all(rhs);
|
||||
self
|
||||
}
|
||||
}
|
||||
|
||||
#[unsafe_destructor]
|
||||
impl<T> Drop for Vec<T> {
|
||||
fn drop(&mut self) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user