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

Commit 161b1d1

Browse files
authored
Merge pull request #164 from dtolnay/readmefloat
Update readme code samples to not fail assert
2 parents 925b871 + 5a81de5 commit 161b1d1

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

‎README.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ fn main() -> Result<(), serde_yaml::Error> {
4848

4949
// Serialize it to a YAML string.
5050
let s = serde_yaml::to_string(&map)?;
51-
assert_eq!(s, "---\nx: 1\ny: 2");
51+
assert_eq!(s, "---\nx: 1.0\ny: 2.0");
5252

5353
// Deserialize it back to a Rust type.
5454
let deserialized_map: BTreeMap<String, f64> = serde_yaml::from_str(&s)?;
@@ -79,7 +79,7 @@ fn main() -> Result<(), serde_yaml::Error> {
7979
let point = Point { x: 1.0, y: 2.0 };
8080

8181
let s = serde_yaml::to_string(&point)?;
82-
assert_eq!(s, "---\nx: 1\ny: 2");
82+
assert_eq!(s, "---\nx: 1.0\ny: 2.0");
8383

8484
let deserialized_point: Point = serde_yaml::from_str(&s)?;
8585
assert_eq!(point, deserialized_point);

0 commit comments

Comments
 (0)