Skip to content

Commit

Permalink
docs: augment preliminary example with serde_json vs deer::json
Browse files Browse the repository at this point in the history
  • Loading branch information
indietyp committed Oct 5, 2022
1 parent bb95c16 commit 3de3e3d
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions packages/libs/deer/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,15 @@ fn main() {
"string": null,
"extra": 1
});

// Note: Syntax is not final!
let result = deer::json::from_string::<Body>(payload);
let error = result.expect_error("should fail");
println!("{error:?}");

let result = serde_json::from_str::<Body>(payload);
let error = result.expect_error("should fail");
println!("{error:?}");
}
```

Expand Down

0 comments on commit 3de3e3d

Please sign in to comment.