diff --git a/src/impls/neon/deser.rs b/src/impls/neon/deser.rs index 8bda50d8..98b4d10e 100644 --- a/src/impls/neon/deser.rs +++ b/src/impls/neon/deser.rs @@ -1,3 +1,5 @@ +use iex::Outcome; + use crate::error::ErrorType; use crate::impls::neon::stage1::bit_mask; use crate::safer_unchecked::GetSaferUnchecked; @@ -169,14 +171,11 @@ pub(crate) fn parse_str<'invoke, 'de>( // within the unicode codepoint handling code. src_i += bs_dist as usize; dst_i += bs_dist as usize; - let (o, s) = if let Ok(r) = + let (o, s) = handle_unicode_codepoint(unsafe { src.get_kinda_unchecked(src_i..) }, unsafe { buffer.get_kinda_unchecked_mut(dst_i..) - }) { - r - } else { - return Err(Deserializer::error_c(src_i, 'u', InvalidUnicodeCodepoint)); - }; + }) + .map_err(|_| Deserializer::error_c(src_i, 'u', InvalidUnicodeCodepoint))?; if o == 0 { return Err(Deserializer::error_c(src_i, 'u', InvalidUnicodeCodepoint)); }; diff --git a/src/numberparse/approx.rs b/src/numberparse/approx.rs index a47804ef..9ea8f1b8 100644 --- a/src/numberparse/approx.rs +++ b/src/numberparse/approx.rs @@ -77,6 +77,7 @@ impl<'de> Deserializer<'de> { clippy::cast_precision_loss, clippy::too_many_lines )] + #[iex::iex] fn parse_float(idx: usize, p: &[u8], negative: bool) -> Result { let mut digitcount = usize::from(negative); let mut i: f64; @@ -222,6 +223,7 @@ impl<'de> Deserializer<'de> { #[cfg(not(feature = "128bit"))] #[inline(never)] #[allow(clippy::cast_possible_wrap)] + #[iex::iex] fn parse_large_integer(idx: usize, buf: &[u8], negative: bool) -> Result { let mut digitcount = usize::from(negative); let mut i: u64; @@ -283,6 +285,7 @@ impl<'de> Deserializer<'de> { #[cfg(feature = "128bit")] #[inline(never)] #[allow(clippy::cast_possible_wrap)] + #[iex::iex] fn parse_large_integer(idx: usize, buf: &[u8], negative: bool) -> Result { let mut digitcount = usize::from(negative); let mut i: u128; @@ -358,6 +361,7 @@ impl<'de> Deserializer<'de> { clippy::cast_possible_wrap, clippy::too_many_lines )] + #[iex::iex] pub(crate) fn parse_number(idx: usize, buf: &[u8], negative: bool) -> Result { let buf = unsafe { buf.get_kinda_unchecked(idx..) }; let mut byte_count = usize::from(negative); diff --git a/src/stringparse.rs b/src/stringparse.rs index f35a9f5e..e9c3a42e 100644 --- a/src/stringparse.rs +++ b/src/stringparse.rs @@ -29,6 +29,7 @@ const LOW_SURROGATES: Range = 0xdc00..0xe000; /// write appropriate values into dest #[cfg_attr(not(feature = "no-inline"), inline)] #[allow(dead_code)] +#[iex::iex] pub(crate) fn handle_unicode_codepoint( src_ptr: &[u8], dst_ptr: &mut [u8], @@ -45,6 +46,7 @@ pub(crate) fn handle_unicode_codepoint( /// return true if the unicode codepoint was valid /// We work in little-endian then swap at write time #[cfg_attr(not(feature = "no-inline"), inline)] +#[iex::iex] pub(crate) fn get_unicode_codepoint(mut src_ptr: &[u8]) -> Result<(u32, usize), ErrorType> { // hex_to_u32_nocheck fills high 16 bits of the return value with 1s if the // conversion isn't valid; we defer the check for this to inside the