From 1f49c85dd2ce0505f7514de20334fe7f33e57619 Mon Sep 17 00:00:00 2001 From: Nico Burns Date: Sun, 15 Mar 2026 17:37:19 +0000 Subject: [PATCH] Use zmij instead of dtoa-short Signed-off-by: Nico Burns --- Cargo.toml | 2 +- src/serializer.rs | 8 +++----- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 0dd2f03a..4506842e 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -15,7 +15,7 @@ rust-version = "1.71" exclude = ["src/css-parsing-tests/**", "src/big-data-url.css"] [dependencies] -dtoa-short = "0.3" +zmij = "1.0.21" itoa = "1.0" smallvec = "1.0" diff --git a/src/serializer.rs b/src/serializer.rs index 8af0cdc5..3e34591e 100644 --- a/src/serializer.rs +++ b/src/serializer.rs @@ -46,10 +46,8 @@ where return write!(dest, "{}", v); } - let notation = dtoa_short::write(dest, value)?; - if value.fract() == 0. && !notation.decimal_point && !notation.scientific { - dest.write_str(".0")?; - } + dest.write_str(zmij::Buffer::new().format(value))?; + Ok(()) } @@ -364,7 +362,7 @@ macro_rules! impl_tocss_for_float { where W: fmt::Write, { - dtoa_short::write(dest, *self).map(|_| ()) + dest.write_str(zmij::Buffer::new().format(*self)) } } };