Skip to main content

cast_slice

Function cast_slice 

Source
unsafe fn cast_slice<T, U>(slice: &[T]) -> &[U]
Expand description

Performs an unsafe pointer cast from one slice type to the other.

ยงCompile-time panics

  • If T and U differ in size
  • If T and U differ in alignment