(&mut self)
| 272 | /// Casts `&mut FastSlice<T>` to `&mut FastSlice<B>`. |
| 273 | #[inline(always)] |
| 274 | pub fn cast<B>(&mut self) -> &mut FastSlice<'a, B> |
| 275 | where |
| 276 | T: bytemuck::Pod, |
| 277 | B: bytemuck::Pod, |
| 278 | { |
| 279 | use std::mem::*; |
| 280 | assert_eq!(size_of::<T>(), size_of::<B>()); |
| 281 | assert_eq!(align_of::<T>(), align_of::<B>()); |
| 282 | // Safety: size/align are equal and both are bytemuck::Pod. |
| 283 | unsafe { transmute(self) } |
| 284 | } |
| 285 | } |
| 286 | |
| 287 | pub trait NextUnchecked<'a, T: Copy> { |