I have fixed size array
x: [T; N]. I want to save part of it in heap allocated memory. And after that (in another code point) I want to copy
count items from some such heap allocated array to fixed size stack allocated array. What is the best way / types to do it?
Currently I use
&x[0..items].to_vec().into_boxed_slice() for first task (give me
Box<[T]>) and don’t know how to do second task. And also
Vec<T> usage (even temporary) looks redundant because I don’t need resizable container just fixed size heap allocated array (but size is determined in runtime).