Function convert_while_ascii

Source
#[doc(hidden)] pub fn convert_while_ascii(
    s: &str,
    convert: fn(&u8) -> u8,
) -> (String, &str)
🔬This is a nightly-only experimental API. (str_internals)
Expand description

Converts leading ascii bytes in s by calling the convert function.

For better average performance, this happens in chunks of 2*size_of::<usize>().

Returns a tuple of the converted prefix and the remainder starting from the first non-ascii character.

This function is only public so that it can be verified in a codegen test, see issue-123712-str-to-lower-autovectorization.rs.