From 7e9935d7ae6e901cd4a2568621d138b65b54221a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20Kijewski?= Date: Tue, 23 Jul 2024 15:30:57 +0200 Subject: [PATCH] Remove floating point optimization --- rinja/Cargo.toml | 1 - rinja/src/filters/escape.rs | 13 ------------- testing/tests/simple.rs | 2 +- 3 files changed, 1 insertion(+), 15 deletions(-) diff --git a/rinja/Cargo.toml b/rinja/Cargo.toml index ff13fff1..deca4e7c 100644 --- a/rinja/Cargo.toml +++ b/rinja/Cargo.toml @@ -35,7 +35,6 @@ with-warp = ["rinja_derive/with-warp"] rinja_derive = { version = "0.2.0", path = "../rinja_derive" } itoa = "1.0.11" -ryu = "1.0.18" humansize = { version = "2", optional = true } num-traits = { version = "0.2.6", optional = true } diff --git a/rinja/src/filters/escape.rs b/rinja/src/filters/escape.rs index eb537274..cb759030 100644 --- a/rinja/src/filters/escape.rs +++ b/rinja/src/filters/escape.rs @@ -549,19 +549,6 @@ const _: () = { NonZeroI8 NonZeroI16 NonZeroI32 NonZeroI64 NonZeroI128 NonZeroIsize ); - macro_rules! specialize_float { - ($($ty:ty)*) => { $( - impl FastWritable for $ty { - #[inline] - fn write_into(&self, dest: &mut W) -> fmt::Result { - dest.write_str(ryu::Buffer::new().format(*self)) - } - } - )* }; - } - - specialize_float!(f32 f64); - impl FastWritable for str { #[inline] fn write_into(&self, dest: &mut W) -> fmt::Result { diff --git a/testing/tests/simple.rs b/testing/tests/simple.rs index 4b73edf7..e4b22fc9 100644 --- a/testing/tests/simple.rs +++ b/testing/tests/simple.rs @@ -490,7 +490,7 @@ fn test_num_literals() { let template = NumLiterals; assert_eq!( template.render().unwrap(), - "[90, -90, 90, 2, 56, 240, 10.5, 10.5, 100000000000.0, 105000000000.0]\n1\n12", + "[90, -90, 90, 2, 56, 240, 10.5, 10.5, 100000000000, 105000000000]\n1\n12", ); }