|
|
|
@ -94,10 +94,15 @@ impl<T> VecExt<T> for Vec<T>
|
|
|
|
|
(0, Some(0)) | (0, None) => (),
|
|
|
|
|
(_, Some(bound)) | (bound, _) => self.reserve(bound),
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
let splice = self.split_off(location);
|
|
|
|
|
self.extend(slice.chain(splice.into_iter()));
|
|
|
|
|
/*
|
|
|
|
|
// shift everything across, replacing with the new values
|
|
|
|
|
let splice: Vec<_> = self.splice(location.., slice).collect();
|
|
|
|
|
// ^ -- this allocation bugs me, but we violate aliasing rules if we don't somehow collect it before adding it back in so...
|
|
|
|
|
// add tail back
|
|
|
|
|
self.extend(splice);
|
|
|
|
|
self.extend(splice);*/
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|