I am also not sure if I understand, but are you looking for something like this:
let Some((array_n, rest)) = array.split_first_chunk::<N>() else { panic!() };
// now it is array_n: &[_; N]
let Some((array_m, _)) = rest.split_first_chunk::<M>() else { panic!() };
... but for owned values?
If you want to use only Copy values, this should work:
let Some((&array_n, rest)) = array.split_first_chunk::<N>() else { panic!() };
// now it is array_n: [_; N]
let Some((&array_m, _)) = rest.split_first_chunk::<M>() else { panic!() };
You can also try_into() a slice into an array of the same length (if Copy), or an array reference:
let arr: [i32; LEN] = array[0..LEN].try_into() else { … }
Unfortunately Rust’s type system cannot currently express the fact that taking an N-length prefix array of an M-length array cannot fail if N<=M.
Edit: actually it’s possible nowadays using const { panic!() }, you still need to unwrap but at least it’s guaranteed to succeed. Once Result::unwrap is const (Option::unwrap already is), then it will be 100% compile-time checked.