| 215 | #[inline(always)] |
| 216 | #[must_use] |
| 217 | pub fn split_at(self, mid: usize) -> (InOutBuf<'inp, 'out, T>, InOutBuf<'inp, 'out, T>) { |
| 218 | assert!(mid <= self.len); |
| 219 | let (tail_in_ptr, tail_out_ptr) = unsafe { (self.in_ptr.add(mid), self.out_ptr.add(mid)) }; |
| 220 | ( |
| 221 | InOutBuf { |
| 222 | in_ptr: self.in_ptr, |
| 223 | out_ptr: self.out_ptr, |
| 224 | len: mid, |
| 225 | _pd: PhantomData, |
| 226 | }, |
| 227 | InOutBuf { |
| 228 | in_ptr: tail_in_ptr, |
| 229 | out_ptr: tail_out_ptr, |
| 230 | len: self.len() - mid, |
| 231 | _pd: PhantomData, |
| 232 | }, |
| 233 | ) |
| 234 | } |
| 235 | |
| 236 | /// Partition buffer into 2 parts: buffer of arrays and tail. |
| 237 | #[inline(always)] |