pub fn files_in_span(&self, span: Span) -> Vec<(&str, Span)> {
        let mut files: Vec<_> = self
            .file_offset_ranges
            .iter()
            .filter(|(_, file_span)| file_span.intersects(&span))
            .collect();
        files.sort_by(|(_, a), (_, b)| {
            if a.low() == b.low() && a.high() == b.high() {
                Ordering::Equal
            } else if a.low() < b.low() {
                // less
                Ordering::Less
            } else if a.low() == b.low() && a.high() < b.high() {
                // less
                Ordering::Less
            } else {
                // greater
                Ordering::Greater
            }
        });

        files.into_iter().map(|(f, s)| (f.as_str(), *s)).collect()
    }
/// Given a span, this will return all the files contained in that span
/// In the order of their position in the span.
Given a span, this will return all the files contained in that span
In the order of their position in the span.
Given a span this will return all the files contained in that span In the order of their position in the span .
pub fn files_in_span(&self, span: Span) -> Vec<(&str, Span)> {
        let mut files: Vec<_> = self
            .file_offset_ranges
            .iter()
            .filter(|(_, file_span)| file_span.intersects(&span))
            .collect();
        files.sort_by(|(_, a), (_, b)| {
            if a.low() == b.low() && a.high() == b.high() {
                Ordering::Equal
            } else if a.low() < b.low() {
                // less
                Ordering::Less
            } else if a.low() == b.low() && a.high() < b.high() {
                // less
                Ordering::Less
            } else {
                // greater
                Ordering::Greater
            }
        });
        files.into_iter().map(|(f, s)| (f.as_str(), *s)).collect()
    }
pub fn files_in_span ( & self , span : Span ) -> Vec < ( & str , Span ) > { let mut files : Vec < _ > = self . file_offset_ranges . iter ( ) . filter ( | ( _ , file_span ) | file_span . intersects ( & span ) ) . collect ( ) ; files . sort_by ( | ( _ , a ) , ( _ , b ) | { if a . low ( ) == b . low ( ) && a . high ( ) == b . high ( ) { Ordering :: Equal } else if a . low ( ) < b . low ( ) { // less Ordering :: Less } else if a . low ( ) == b . low ( ) && a . high ( ) < b . high ( ) { // less Ordering :: Less } else { // greater Ordering :: Greater } } ) ; files . into_iter ( ) . map ( | ( f , s ) | ( f . as_str ( ) , * s ) ) . collect ( ) }
Given a span, this will return all the files contained in that span
In the order of their position in the span.
Given a span this will return all the files contained in that span In the order of their position in the span .
&self
span
Span
&self
span
Span