Hi, experts. Code that works:
use std::convert::TryInto;
fn foo<const N: usize>(buffer: &[u8]) -> Result<&[u8;N], std::array::TryFromSliceError> {
buffer.try_into()
}
fn bar<const N: usize>(buffer: &[u8]) -> Result<&[u8;N], std::array::TryFromSliceError> {
TryInto::try_into(buffer)
}
What's the expanded form that includes the types, &[u8]
and &[u8;N]
, explicitly?
Thanks in advance.