(&mut self, vm: &VirtualMachine, n: isize)
| 121 | fn as_vec_mut(&mut self) -> &mut Vec<T>; |
| 122 | |
| 123 | fn imul(&mut self, vm: &VirtualMachine, n: isize) -> PyResult<()> { |
| 124 | let n = vm.check_repeat_or_overflow_error(self.as_ref().len(), n)?; |
| 125 | if n == 0 { |
| 126 | self.as_vec_mut().clear(); |
| 127 | } else if n != 1 { |
| 128 | let mut sample = self.as_vec_mut().clone(); |
| 129 | if n != 2 { |
| 130 | self.as_vec_mut().reserve(sample.len() * (n - 1)); |
| 131 | for _ in 0..n - 2 { |
| 132 | self.as_vec_mut().extend_from_slice(&sample); |
| 133 | } |
| 134 | } |
| 135 | self.as_vec_mut().append(&mut sample); |
| 136 | } |
| 137 | Ok(()) |
| 138 | } |
| 139 | } |
| 140 | |
| 141 | impl<T: Clone> SequenceMutExt<T> for Vec<T> { |
nothing calls this directly
no test coverage detected