pub fn slice_source_location(
src: &SourceLocation,
start: usize,
length: usize,
) -> SourceLocationExpand description
Slice the source location.
§Arguments
src- The source locationstart- The start indexlength- The length of the sliced source
§Returns
The sliced source location.
§Example
let src = SourceLocation { start: Some(1), length: Some(10), index: Some(0) };
let sliced = slice_source_location(&src, 1, 3);
assert_eq!(sliced.start, Some(2));
assert_eq!(sliced.length, Some(3));
assert_eq!(sliced.index, Some(0));