Skip to content
This repository has been archived by the owner on Mar 25, 2024. It is now read-only.

Commit

Permalink
Switch float serializer from dtoa to ryu
Browse files Browse the repository at this point in the history
  • Loading branch information
dtolnay committed Dec 13, 2021
1 parent 7a02d73 commit 6b83603
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Expand Up @@ -12,7 +12,7 @@ readme = "README.md"
keywords = ["yaml", "serde"]

[dependencies]
dtoa = "1.0"
ryu = "1.0"
indexmap = "1.5"
serde = "1.0.69"
yaml-rust = "0.4.5"
Expand Down
4 changes: 2 additions & 2 deletions src/ser.rs
Expand Up @@ -518,7 +518,7 @@ impl ser::Serializer for SerializerToYaml {
num::FpCategory::Infinite if v.is_sign_positive() => ".inf".into(),
num::FpCategory::Infinite => "-.inf".into(),
num::FpCategory::Nan => ".nan".into(),
_ => dtoa::Buffer::new().format_finite(v).into(),
_ => ryu::Buffer::new().format_finite(v).into(),
}))
}

Expand All @@ -527,7 +527,7 @@ impl ser::Serializer for SerializerToYaml {
num::FpCategory::Infinite if v.is_sign_positive() => ".inf".into(),
num::FpCategory::Infinite => "-.inf".into(),
num::FpCategory::Nan => ".nan".into(),
_ => dtoa::Buffer::new().format_finite(v).into(),
_ => ryu::Buffer::new().format_finite(v).into(),
}))
}

Expand Down

0 comments on commit 6b83603

Please sign in to comment.