pub(crate) fn subslice<I, T>(input: &[T], index: I) -> Result<&I::Output>where I: SliceIndex<[T]>,
Slice the given slice of bytes safely and return an error if the slice is too small.