From 5a81de58bd0402a13cd73a7e6a6c894caf9bead5 Mon Sep 17 00:00:00 2001 From: David Tolnay Date: Tue, 9 Jun 2020 23:57:49 -0700 Subject: [PATCH] Update readme code samples to not fail assert --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 8b2e9630..d599e3a1 100644 --- a/README.md +++ b/README.md @@ -48,7 +48,7 @@ fn main() -> Result<(), serde_yaml::Error> { // Serialize it to a YAML string. let s = serde_yaml::to_string(&map)?; - assert_eq!(s, "---\nx: 1\ny: 2"); + assert_eq!(s, "---\nx: 1.0\ny: 2.0"); // Deserialize it back to a Rust type. let deserialized_map: BTreeMap = serde_yaml::from_str(&s)?; @@ -79,7 +79,7 @@ fn main() -> Result<(), serde_yaml::Error> { let point = Point { x: 1.0, y: 2.0 }; let s = serde_yaml::to_string(&point)?; - assert_eq!(s, "---\nx: 1\ny: 2"); + assert_eq!(s, "---\nx: 1.0\ny: 2.0"); let deserialized_point: Point = serde_yaml::from_str(&s)?; assert_eq!(point, deserialized_point);