pub fn from_line_cols_offset(
        file: RcOc<RelativePath>,
        line: usize,
        cols: Range<usize>,
        start_offset: usize,
    ) -> Self {
        let start = FilePosSmall::from_line_column_offset(line, cols.start, start_offset);
        let end = FilePosSmall::from_line_column_offset(
            line,
            cols.end,
            start_offset + (cols.end - cols.start),
        );
        match (start, end) {
            (Some(start), Some(end)) => Pos(Small { file, start, end }),
            _ => {
                let start = Box::new(FilePosLarge::from_line_column_offset(
                    line,
                    cols.start,
                    start_offset,
                ));
                let end = Box::new(FilePosLarge::from_line_column_offset(
                    line,
                    cols.end,
                    start_offset + (cols.end - cols.start),
                ));
                Pos(Large { file, start, end })
            }
        }
    }
/// For single-line spans only.
For single-line spans only.
For single - line spans only .
pub fn from_line_cols_offset(
        file: RcOc<RelativePath>,
        line: usize,
        cols: Range<usize>,
        start_offset: usize,
    ) -> Self {
        let start = FilePosSmall::from_line_column_offset(line, cols.start, start_offset);
        let end = FilePosSmall::from_line_column_offset(
            line,
            cols.end,
            start_offset + (cols.end - cols.start),
        );
        match (start, end) {
            (Some(start), Some(end)) => Pos(Small { file, start, end }),
            _ => {
                let start = Box::new(FilePosLarge::from_line_column_offset(
                    line,
                    cols.start,
                    start_offset,
                ));
                let end = Box::new(FilePosLarge::from_line_column_offset(
                    line,
                    cols.end,
                    start_offset + (cols.end - cols.start),
                ));
                Pos(Large { file, start, end })
            }
        }
    }
pub fn from_line_cols_offset ( file : RcOc < RelativePath > , line : usize , cols : Range < usize > , start_offset : usize , ) -> Self { let start = FilePosSmall :: from_line_column_offset ( line , cols . start , start_offset ) ; let end = FilePosSmall :: from_line_column_offset ( line , cols . end , start_offset + ( cols . end - cols . start ) , ) ; match ( start , end ) { ( Some ( start ) , Some ( end ) ) => Pos ( Small { file , start , end } ) , _ => { let start = Box :: new ( FilePosLarge :: from_line_column_offset ( line , cols . start , start_offset , ) ) ; let end = Box :: new ( FilePosLarge :: from_line_column_offset ( line , cols . end , start_offset + ( cols . end - cols . start ) , ) ) ; Pos ( Large { file , start , end } ) } } }
For single-line spans only.
For single - line spans only .
file
RcOc<RelativePath>
line
usize
cols
Range<usize>
start_offset
usize