Open
Description
In #1644, @makotokato is trying to produce a ZeroVec
from include_bytes!()
. Currently he uses a transmute to coerce the bytes into a ULE slice. This is not logic that should have to live at the call site.
I think we can't use parse_byte_slice
because it's a trait function, which is unfortunate. However, we can solve this on a case-by-case basis by adding const constructors, like
const FOO: &[u16::ULE; 100] = u16::ULE::from_byte_array_const(
include_bytes!("...")
)
.expect("all bytes are valid for u16::ULE");
CC @Manishearth