pub fn to_index(self, content:impl AsRef<str>) -> Index {
        let line_index = match self.line {
            0 => 0,
            _ => {
                let content = content.as_ref();
                newline_indices(content).nth(self.line.saturating_sub(1)).map_or(0, |i| i + 1)
            }
        };
        Index::new(line_index + self.column)
    }
/// Convert self to the text index.
///
/// This operation involves iterating over content characters and is O(n).
///
/// Behavior for out-of-bounds index conversion is unspecified but will never panic.
Convert self to the text index.
This operation involves iterating over content characters and is O(n).

Behavior for out-of-bounds index conversion is unspecified but will never panic.
Convert self to the text index . This operation involves iterating over content characters and is O ( n ) . Behavior for out - of - bounds index conversion is unspecified but will never panic .
pub fn to_index(self, content:impl AsRef<str>) -> Index {
        let line_index = match self.line {
            0 => 0,
            _ => {
                let content = content.as_ref();
                newline_indices(content).nth(self.line.saturating_sub(1)).map_or(0, |i| i + 1)
            }
        };
        Index::new(line_index + self.column)
    }
pub fn to_index ( self , content : impl AsRef < str > ) -> Index { let line_index = match self . line { 0 => 0 , _ => { let content = content . as_ref ( ) ; newline_indices ( content ) . nth ( self . line . saturating_sub ( 1 ) ) . map_or ( 0 , | i | i + 1 ) } } ; Index :: new ( line_index + self . column ) }
Convert self to the text index.
Convert self to the text index .
self
content
impl AsRef<str>
self
content
impl AsRef<str>