MCPcopy Create free account
hub / github.com/SoftbearStudios/bitcode / cast_mut

Method cast_mut

src/fast.rs:429–439  ·  view source on GitHub ↗
(&mut self)

Source from the content-addressed store, hash-verified

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
442pub struct SetOwned<'a, 'borrowed, T>(&'a mut CowSlice<'borrowed, T>);

Callers 2

unpack_bytesFunction · 0.80
unpack_ints_sizedFunction · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected