/// The column index at the given byte index in the source file.
/// This is the number of characters to the given byte index.
///
/// If the byte index is smaller than the start of the line, then `0` is returned.
/// If the byte index is past the end of the line, the column index of the last
/// character `+ 1` is returned.
The column index at the given byte index in the source file.
This is the number of characters to the given byte index.

If the byte index is smaller than the start of the line, then `0` is returned.
If the byte index is past the end of the line, the column index of the last
character `+ 1` is returned.
The column index at the given byte index in the source file . This is the number of characters to the given byte index . If the byte index is smaller than the start of the line then ` 0 ` is returned . If the byte index is past the end of the line the column index of the last character ` + 1 ` is returned .
pub fn column_index(source: &str, line_range: core::ops::Range<usize>, byte_index: usize) -> usize {
    let end_index = core::cmp::min(byte_index, core::cmp::min(line_range.end, source.len()));
    (line_range.start..end_index)
        .filter(|byte_index| source.is_char_boundary(byte_index + 1))
        .count()
}
pub fn column_index ( source : & str , line_range : core :: ops :: Range < usize > , byte_index : usize ) -> usize { let end_index = core :: cmp :: min ( byte_index , core :: cmp :: min ( line_range . end , source . len ( ) ) ) ; ( line_range . start .. end_index ) . filter ( | byte_index | source . is_char_boundary ( byte_index + 1 ) ) . count ( ) }
The column index at the given byte index in the source file.
The column index at the given byte index in the source file .
source
&str
line_range
core::ops::Range<usize>
byte_index
usize