fn find_non_ascii_or_escape(buffer: &[u8]) -> usize {
    let ascii_up_to = Encoding::ascii_valid_up_to(buffer);
    if let Some(escape) = memchr::memchr(0x1B, &buffer[..ascii_up_to]) {
        escape
    } else {
        ascii_up_to
    }
}
/// Returns the index of the first non-ASCII byte or the first
/// 0x1B, whichever comes first, or the length of the buffer
/// if neither is found.
Returns the index of the first non-ASCII byte or the first
0x1B, whichever comes first, or the length of the buffer
if neither is found.
Returns the index of the first non - ASCII byte or the first 0x1B whichever comes first or the length of the buffer if neither is found .
fn find_non_ascii_or_escape(buffer: &[u8]) -> usize {
    let ascii_up_to = Encoding::ascii_valid_up_to(buffer);
    if let Some(escape) = memchr::memchr(0x1B, &buffer[..ascii_up_to]) {
        escape
    } else {
        ascii_up_to
    }
}
fn find_non_ascii_or_escape ( buffer : & [ u8 ] ) -> usize { let ascii_up_to = Encoding :: ascii_valid_up_to ( buffer ) ; if let Some ( escape ) = memchr :: memchr ( 0x1B , & buffer [ .. ascii_up_to ] ) { escape } else { ascii_up_to } }
Returns the index of the first non-ASCII byte or the first
0x1B, whichever comes first, or the length of the buffer
if neither is found.
Returns the index of the first non - ASCII byte or the first 0x1B whichever comes first or the length of the buffer if neither is found .
buffer
&[u8]
buffer
&[u8]