pub fn slice_n_into_unchecked<T, V, const N: usize>(slice: &[T]) -> V
Expand description
Just like slice_n_into
but without the checking.
ยงExamples
#[derive(Debug, PartialEq)]
struct Ljf([u8; 17]);
impl From<[u8; 17]> for Ljf {
fn from(array: [u8; 17]) -> Self {
Self(array)
}
}
assert_eq!(
array_bytes::slice_n_into_unchecked::<u8, Ljf, 17>(b"Love Jane Forever"),
Ljf(*b"Love Jane Forever")
);