diff --git a/compact_str/Cargo.toml b/compact_str/Cargo.toml index fd6f4925..045df4e5 100644 --- a/compact_str/Cargo.toml +++ b/compact_str/Cargo.toml @@ -61,7 +61,7 @@ castaway = { version = "0.2.3", default-features = false, features = ["alloc"] } cfg-if = "1" itoa = "1" rustversion = "1" -ryu = "1" +zmij = "0.1" static_assertions = "1" [dev-dependencies] diff --git a/compact_str/src/repr/traits.rs b/compact_str/src/repr/traits.rs index c530d73f..0d7dd095 100644 --- a/compact_str/src/repr/traits.rs +++ b/compact_str/src/repr/traits.rs @@ -14,7 +14,7 @@ pub(crate) trait IntoRepr { impl IntoRepr for f32 { #[inline] fn into_repr(self) -> Result { - let mut buf = ryu::Buffer::new(); + let mut buf = zmij::Buffer::new(); let s = buf.format(self); Ok(Repr::new(s)?) } @@ -23,7 +23,7 @@ impl IntoRepr for f32 { impl IntoRepr for f64 { #[inline] fn into_repr(self) -> Result { - let mut buf = ryu::Buffer::new(); + let mut buf = zmij::Buffer::new(); let s = buf.format(self); Ok(Repr::new(s)?) } @@ -114,7 +114,7 @@ mod tests { let repr = f64::into_repr(val).unwrap(); let roundtrip = repr.as_str().parse::().unwrap(); - // Note: The formatting of floats by `ryu` sometimes differs from that of `std`, so instead + // Note: The formatting of floats by `zmij` sometimes differs from that of `std`, so instead // of asserting equality with `std` we just make sure the value roundtrips if val.is_nan() != roundtrip.is_nan() { @@ -122,7 +122,7 @@ mod tests { } } - // `f32` formatting is broken on powerpc64le, not only in `ryu` but also `std` + // `f32` formatting is broken on powerpc64le, not only in `zmij` but also `std` // // See: https://github.com/rust-lang/rust/issues/96306 #[test] @@ -158,7 +158,7 @@ mod tests { let repr = f32::into_repr(val).unwrap(); let roundtrip = repr.as_str().parse::().unwrap(); - // Note: The formatting of floats by `ryu` sometimes differs from that of `std`, so instead + // Note: The formatting of floats by `zmij` sometimes differs from that of `std`, so instead // of asserting equality with `std` we just make sure the value roundtrips if val.is_nan() != roundtrip.is_nan() { diff --git a/compact_str/src/tests.rs b/compact_str/src/tests.rs index 2aeeac46..82eb2276 100644 --- a/compact_str/src/tests.rs +++ b/compact_str/src/tests.rs @@ -937,7 +937,7 @@ fn test_to_compact_string() { assert_int_MAX_to_compact_string!(usize); assert_int_MAX_to_compact_string!(isize); - // Test specialisation for f32 and f64 using ryu + // Test specialisation for f32 and f64 using zmij // TODO: Fix bug in powerpc64, which is a little endian system #[cfg(not(all(target_arch = "powerpc64", target_pointer_width = "64")))] { diff --git a/compact_str/src/traits.rs b/compact_str/src/traits.rs index 52b58c4b..461dfea2 100644 --- a/compact_str/src/traits.rs +++ b/compact_str/src/traits.rs @@ -72,7 +72,7 @@ unsafe impl LifetimeFree for Repr {} /// * `char` /// * `String`, `CompactString` /// * `f32`, `f64` -/// * For floats we use [`ryu`] crate which sometimes provides different formatting than [`std`] +/// * For floats we use [`zmij`] crate which sometimes provides different formatting than [`std`] impl ToCompactString for T { #[inline] fn try_to_compact_string(&self) -> Result { diff --git a/fuzz/src/creation.rs b/fuzz/src/creation.rs index 7c68a7e1..8352d596 100644 --- a/fuzz/src/creation.rs +++ b/fuzz/src/creation.rs @@ -635,7 +635,7 @@ impl Creation<'_> { NumType::I128(val) => (val.to_compact_string(), val.to_string()), NumType::Usize(val) => (val.to_compact_string(), val.to_string()), NumType::Isize(val) => (val.to_compact_string(), val.to_string()), - // Note: The formatting of floats by `ryu` sometimes differs from that of + // Note: The formatting of floats by `zmij` sometimes differs from that of // `std`, so instead of asserting equality with `std` we just make sure the // value roundtrips NumType::F32(val) => {