Function textspan::lift_spans_index[][src]

pub fn lift_spans_index(
    spans: &[Span],
    target_spans: &[Span]
) -> Vec<(Result<usize, usize>, Result<usize, usize>)>

Convert spans indices on target_spans

Example

use textspan::lift_spans_index;
let target_spans = [(3, 5), (5, 9), (11, 15)];

assert_eq!(lift_spans_index(&[(3, 9)], &target_spans), &[(Ok(0), Ok(2))]);