(&mut self)
| 427 | /// Casts `&mut CowSlice<T>` to `&mut CowSlice<B>`. |
| 428 | #[inline] |
| 429 | pub fn cast_mut<B>(&mut self) -> &mut CowSlice<'borrowed, B> |
| 430 | where |
| 431 | T: bytemuck::Pod, |
| 432 | B: bytemuck::Pod, |
| 433 | { |
| 434 | use std::mem::*; |
| 435 | assert_eq!(size_of::<T>(), size_of::<B>()); |
| 436 | assert_eq!(align_of::<T>(), align_of::<B>()); |
| 437 | // Safety: size/align are equal and both are bytemuck::Pod. |
| 438 | unsafe { transmute(self) } |
| 439 | } |
| 440 | } |
| 441 | |
| 442 | pub struct SetOwned<'a, 'borrowed, T>(&'a mut CowSlice<'borrowed, T>); |
no outgoing calls
no test coverage detected