Skip to content

Commit 1f49c85

Browse files
committed
Use zmij instead of dtoa-short
Signed-off-by: Nico Burns <nico@nicoburns.com>
1 parent 4d4568b commit 1f49c85

2 files changed

Lines changed: 4 additions & 6 deletions

File tree

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ rust-version = "1.71"
1515
exclude = ["src/css-parsing-tests/**", "src/big-data-url.css"]
1616

1717
[dependencies]
18-
dtoa-short = "0.3"
18+
zmij = "1.0.21"
1919
itoa = "1.0"
2020
smallvec = "1.0"
2121

src/serializer.rs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -46,10 +46,8 @@ where
4646
return write!(dest, "{}", v);
4747
}
4848

49-
let notation = dtoa_short::write(dest, value)?;
50-
if value.fract() == 0. && !notation.decimal_point && !notation.scientific {
51-
dest.write_str(".0")?;
52-
}
49+
dest.write_str(zmij::Buffer::new().format(value))?;
50+
5351
Ok(())
5452
}
5553

@@ -364,7 +362,7 @@ macro_rules! impl_tocss_for_float {
364362
where
365363
W: fmt::Write,
366364
{
367-
dtoa_short::write(dest, *self).map(|_| ())
365+
dest.write_str(zmij::Buffer::new().format(*self))
368366
}
369367
}
370368
};

0 commit comments

Comments
 (0)