Function byte_range_to_char_range

Source
pub fn byte_range_to_char_range<R>(s: &str, byte_range: R) -> Option<Range>
where R: RangeBounds<usize>,
Expand description

Convert a given byte range of a string, that is known to be at valid char bounds, to a character range.

If the bounds are not bounded by a character, it will take the bounding characters that are intersected inclusive.