| 634 | /// Move all values from `other` into this vec. |
| 635 | #[inline] |
| 636 | pub fn append(&mut self, other: &mut Self) { |
| 637 | self.reserve(other.len()); |
| 638 | |
| 639 | /* Doing append should be faster, because it is effectively a memcpy */ |
| 640 | match (self, other) { |
| 641 | (TinyVec::Heap(sh), TinyVec::Heap(oh)) => sh.append(oh), |
| 642 | (TinyVec::Inline(a), TinyVec::Heap(h)) => a.extend(h.drain(..)), |
| 643 | (ref mut this, TinyVec::Inline(arr)) => this.extend(arr.drain(..)), |
| 644 | } |
| 645 | } |
| 646 | |
| 647 | impl_mirrored! { |
| 648 | type Mirror = TinyVec; |