Skip to content

Commit 478bbbd

Browse files
committed
Some more iexing
Signed-off-by: Heinz N. Gies <[email protected]>
1 parent 45e0f29 commit 478bbbd

File tree

3 files changed

+11
-6
lines changed

3 files changed

+11
-6
lines changed

src/impls/neon/deser.rs

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
use iex::Outcome;
2+
13
use crate::error::ErrorType;
24
use crate::impls::neon::stage1::bit_mask;
35
use crate::safer_unchecked::GetSaferUnchecked;
@@ -169,14 +171,11 @@ pub(crate) fn parse_str<'invoke, 'de>(
169171
// within the unicode codepoint handling code.
170172
src_i += bs_dist as usize;
171173
dst_i += bs_dist as usize;
172-
let (o, s) = if let Ok(r) =
174+
let (o, s) =
173175
handle_unicode_codepoint(unsafe { src.get_kinda_unchecked(src_i..) }, unsafe {
174176
buffer.get_kinda_unchecked_mut(dst_i..)
175-
}) {
176-
r
177-
} else {
178-
return Err(Deserializer::error_c(src_i, 'u', InvalidUnicodeCodepoint));
179-
};
177+
})
178+
.map_err(|_| Deserializer::error_c(src_i, 'u', InvalidUnicodeCodepoint))?;
180179
if o == 0 {
181180
return Err(Deserializer::error_c(src_i, 'u', InvalidUnicodeCodepoint));
182181
};

src/numberparse/approx.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ impl<'de> Deserializer<'de> {
7777
clippy::cast_precision_loss,
7878
clippy::too_many_lines
7979
)]
80+
#[iex::iex]
8081
fn parse_float(idx: usize, p: &[u8], negative: bool) -> Result<StaticNode> {
8182
let mut digitcount = usize::from(negative);
8283
let mut i: f64;
@@ -222,6 +223,7 @@ impl<'de> Deserializer<'de> {
222223
#[cfg(not(feature = "128bit"))]
223224
#[inline(never)]
224225
#[allow(clippy::cast_possible_wrap)]
226+
#[iex::iex]
225227
fn parse_large_integer(idx: usize, buf: &[u8], negative: bool) -> Result<StaticNode> {
226228
let mut digitcount = usize::from(negative);
227229
let mut i: u64;
@@ -283,6 +285,7 @@ impl<'de> Deserializer<'de> {
283285
#[cfg(feature = "128bit")]
284286
#[inline(never)]
285287
#[allow(clippy::cast_possible_wrap)]
288+
#[iex::iex]
286289
fn parse_large_integer(idx: usize, buf: &[u8], negative: bool) -> Result<StaticNode> {
287290
let mut digitcount = usize::from(negative);
288291
let mut i: u128;
@@ -358,6 +361,7 @@ impl<'de> Deserializer<'de> {
358361
clippy::cast_possible_wrap,
359362
clippy::too_many_lines
360363
)]
364+
#[iex::iex]
361365
pub(crate) fn parse_number(idx: usize, buf: &[u8], negative: bool) -> Result<StaticNode> {
362366
let buf = unsafe { buf.get_kinda_unchecked(idx..) };
363367
let mut byte_count = usize::from(negative);

src/stringparse.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ const LOW_SURROGATES: Range<u32> = 0xdc00..0xe000;
2929
/// write appropriate values into dest
3030
#[cfg_attr(not(feature = "no-inline"), inline)]
3131
#[allow(dead_code)]
32+
#[iex::iex]
3233
pub(crate) fn handle_unicode_codepoint(
3334
src_ptr: &[u8],
3435
dst_ptr: &mut [u8],
@@ -45,6 +46,7 @@ pub(crate) fn handle_unicode_codepoint(
4546
/// return true if the unicode codepoint was valid
4647
/// We work in little-endian then swap at write time
4748
#[cfg_attr(not(feature = "no-inline"), inline)]
49+
#[iex::iex]
4850
pub(crate) fn get_unicode_codepoint(mut src_ptr: &[u8]) -> Result<(u32, usize), ErrorType> {
4951
// hex_to_u32_nocheck fills high 16 bits of the return value with 1s if the
5052
// conversion isn't valid; we defer the check for this to inside the

0 commit comments

Comments
 (0)