diff --git a/Cargo.toml b/Cargo.toml index fac2cc86..e6440d0e 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -14,9 +14,9 @@ rust-version = "1.88" [dependencies] simdutf8 = { version = "0.1.4", features = ["public_imp", "aarch64_neon"] } -value-trait = { version = "0.11" } +value-trait = { version = "0.12" } beef = { version = "0.5", optional = true } -halfbrown = "0.3" +halfbrown = "0.4" # ahash known key once_cell = { version = "1.21", optional = true } ahash = { version = "0.8", optional = true } diff --git a/src/impls/neon/stage1.rs b/src/impls/neon/stage1.rs index 0401ee33..fc8ac700 100644 --- a/src/impls/neon/stage1.rs +++ b/src/impls/neon/stage1.rs @@ -204,7 +204,7 @@ impl Stage1Parse for SimdInput { base.reserve(64); let final_len = l + cnt; - let is_unaligned = l % 4 != 0; + let is_unaligned = !l.is_multiple_of(4); let write_fn = if is_unaligned { std::ptr::write_unaligned } else { diff --git a/src/macros.rs b/src/macros.rs index d1691902..93bf572b 100644 --- a/src/macros.rs +++ b/src/macros.rs @@ -1248,16 +1248,6 @@ macro_rules! static_cast_i64 { } pub(crate) use static_cast_i64; -/// static cast to an i64 -#[cfg(all(feature = "approx-number-parsing", feature = "i128"))] -macro_rules! static_cast_i128 { - ($v:expr_2021) => { - ::std::mem::transmute::<_, i128>($v) - }; -} -#[cfg(all(feature = "approx-number-parsing", feature = "i128"))] -pub(crate) use static_cast_i128; - /// static cast to an u64 macro_rules! static_cast_u64 { ($v:expr_2021) => { diff --git a/src/numberparse/approx.rs b/src/numberparse/approx.rs index 61113ecb..be283407 100644 --- a/src/numberparse/approx.rs +++ b/src/numberparse/approx.rs @@ -336,7 +336,7 @@ impl Deserializer<'_> { ErrorType::InvalidNumber, )) } else if negative { - let i = unsafe { static_cast_i128!(i.wrapping_neg()) }; + let i: i128 = i.wrapping_neg().cast_signed(); if let Ok(i) = i64::try_from(i) { Ok(StaticNode::I64(i)) } else { diff --git a/src/tests.rs b/src/tests.rs index 9d1ccc0a..4ef3597c 100644 --- a/src/tests.rs +++ b/src/tests.rs @@ -166,7 +166,7 @@ fn silly_float1() { } #[test] -#[ignore] +#[ignore = "serde is less precise on this test"] fn silly_float2() { let v = Value::from(-6.990_585_694_841_803e305); let s = v.encode(); diff --git a/src/tests/serde.rs b/src/tests/serde.rs index 5abf4a79..fdb1f042 100644 --- a/src/tests/serde.rs +++ b/src/tests/serde.rs @@ -585,8 +585,7 @@ fn float1() { assert_eq!(v_simd, v_serde); } -// We ignore this since serde is less precise on this test -#[ignore] +#[ignore = "We ignore this since serde is less precise on this test"] #[test] fn float2() { let mut d = String::from("-4.5512678569607477e306");