diff --git a/src/ext.rs b/src/ext.rs index 011c652..8a9e4ed 100644 --- a/src/ext.rs +++ b/src/ext.rs @@ -94,10 +94,15 @@ impl VecExt for Vec (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);*/ } }