/// Find the nearest next line position.
/// Does not check for new line characters embedded in String fields.
Find the nearest next line position.
Does not check for new line characters embedded in String fields.
Find the nearest next line position . Does not check for new line characters embedded in String fields .
pub(crate) fn next_line_position_naive(input: &[u8]) -> Option<usize> {
    let pos = input.iter().position(|b| *b == b'\n')? + 1;
    if input.len() - pos == 0 {
        return None;
    }
    input.get(pos + 1).and_then(|&b| {
        Option::from({
            if b == b'\r' {
                pos + 1
            } else {
                pos
            }
        })
    })
}
pub ( crate ) fn next_line_position_naive ( input : & [ u8 ] ) -> Option < usize > { let pos = input . iter ( ) . position ( | b | * b == b'\n' ) ? + 1 ; if input . len ( ) - pos == 0 { return None ; } input . get ( pos + 1 ) . and_then ( | & b | { Option :: from ( { if b == b'\r' { pos + 1 } else { pos } } ) } ) }
Find the nearest next line position.
Find the nearest next line position .
input
&[u8]