Skip to content

Commit

Permalink
Remove floating point optimization
Browse files Browse the repository at this point in the history
  • Loading branch information
Kijewski committed Jul 23, 2024
1 parent b759946 commit 7e9935d
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 15 deletions.
1 change: 0 additions & 1 deletion rinja/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }
Expand Down
13 changes: 0 additions & 13 deletions rinja/src/filters/escape.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<W: fmt::Write + ?Sized>(&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<W: fmt::Write + ?Sized>(&self, dest: &mut W) -> fmt::Result {
Expand Down
2 changes: 1 addition & 1 deletion testing/tests/simple.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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",
);
}

Expand Down

0 comments on commit 7e9935d

Please sign in to comment.