pub trait Deconstruct<T, const N: usize> {
// Required methods
fn uncons(self) -> (T, [T; { _ }]);
fn unsnoc(self) -> ([T; { _ }], T);
fn init(self) -> [T; { _ }];
fn tail(self) -> [T; { _ }];
fn last(self) -> T
where [(); { _ }]:;
fn head(self) -> T
where [(); { _ }]:;
}Expand description
Deconstruct some array. Use
let [t, arr @ ..] = [1, 2];when possible. If the length of the array is a const generic, use
let (t, arr) = [1, 2].uncons();