Skip to main content

check_range

Function check_range 

Source
const fn check_range(slice: &str, range: Range<usize>) -> bool
Expand description

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).