Always inline run_utf8_validation.

It only has two call sites, and the one within `from_utf8` is hot within
rustc itself.
This commit is contained in:
Nicholas Nethercote 2020-02-18 15:42:11 +11:00
parent 5e7af4669f
commit ab906179cc

View file

@ -1499,7 +1499,7 @@ fn contains_nonascii(x: usize) -> bool {
/// Walks through `v` checking that it's a valid UTF-8 sequence,
/// returning `Ok(())` in that case, or, if it is invalid, `Err(err)`.
#[inline]
#[inline(always)]
fn run_utf8_validation(v: &[u8]) -> Result<(), Utf8Error> {
let mut index = 0;
let len = v.len();