find_range_including_delimiters

Function find_range_including_delimiters 

Source
pub fn find_range_including_delimiters(
    source_str: &str,
    pos_cursor: &mut usize,
    start_delimiter: &str,
    end_delimiter: &str,
) -> Option<Range<usize>>
Expand description

find and return the range of the first occurrence including start and end delimiters
Success: mutates also the cursor position, so the next find will continue from there
Fail: return None if not found and don’t mutate pos_cursor
I use type Range to avoid references &str and lifetimes. But the programmer can make
the error to apply the range to the wrong vector.