pub fn check_len_str<T: ?Sized>(slice: &str, val: &T) -> Result<()>