Removes an element from the list at the given index. The removed element is replaced with the last element of the list and the list is shrunk by one element.
(&mut self, index: usize, pool: &mut CompactListPool<T>)
| 98 | /// The removed element is replaced with the last element of the list and |
| 99 | /// the list is shrunk by one element. |
| 100 | pub fn swap_remove(&mut self, index: usize, pool: &mut CompactListPool<T>) { |
| 101 | let slice = self.as_mut_slice(pool); |
| 102 | slice.swap(index, slice.len() - 1); |
| 103 | self.end -= 1; |
| 104 | } |
| 105 | } |
| 106 | |
| 107 | impl<T> Default for CompactList<T> { |
no test coverage detected