pub fn from_array_mut<const ARR: usize, const SIZE: usize>(
    buf: &mut [u8; ARR]
) -> &mut [u8; SIZE]
Expand description

Get a fixed sized mutable slice from a fixed sized slice. Won’t compile if the buffer is not large enough.

let mut mem = [0u8; 2];
let _: &mut [u8; 2] = from_array_mut(&mut mem);
let mem = [0u8; 1];
let _: &mut [u8; 2] = from_array_mut(&mut mem);