pub fn check_len<V, T: ?Sized>(slice: &[V], val: &T) -> Result<()>