栈末尾加入新的 LVec
(&mut self, other: &mut Self)
| 69 | |
| 70 | // 栈末尾加入新的 LVec |
| 71 | fn append(&mut self, other: &mut Self) { |
| 72 | while let Some(node) = other.head.as_mut().take() { |
| 73 | self.push(node.elem); |
| 74 | other.head = node.next.take(); |
| 75 | } |
| 76 | other.clear(); |
| 77 | } |
| 78 | |
| 79 | fn insert(&mut self, mut index: usize, elem: T) { |
| 80 | if index >= self.size { index = self.size; } |
no test coverage detected