Skip to main content

array_ptr_as_mut

Function array_ptr_as_mut 

Source
pub(crate) const fn array_ptr_as_mut<T, const N: usize>(
    ptr: *mut [T; N],
) -> *mut T
Expand description

Replacement for the unstable <*mut [T; N]>::as_mut_ptr method, which avoids possibility of type getting lost from using e.g. .cast() to change array type to point to the data.

⚠️ Internal Docs ⚠️ Not Public API 👉 Official Docs Here