Function check_range
pub(in ::str::traits) const fn check_range(slice: &str, range: Range<usize>) -> bool
Check that a range is in bounds for slicing a string.
If this returns true, it is safe to call slice.get_unchecked(range) or
slice.get_unchecked_mut(range).