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

Commit

Permalink
Merge pull request #164 from dtolnay/readmefloat
Browse files Browse the repository at this point in the history
Update readme code samples to not fail assert
  • Loading branch information
dtolnay authored Jun 10, 2020
2 parents 925b871 + 5a81de5 commit 161b1d1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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<String, f64> = serde_yaml::from_str(&s)?;
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit 161b1d1

Please sign in to comment.