mirror of
https://github.com/rust-lang-nursery/rust-cookbook
synced 2024-11-22 11:33:09 +00:00
Wrapped markdown code around assert_eq! macro
This commit is contained in:
parent
6ec45fe16f
commit
dfd355158c
1 changed files with 2 additions and 1 deletions
|
@ -5,7 +5,8 @@
|
||||||
The example below shows two simple ways to embed JSON in Rust.
|
The example below shows two simple ways to embed JSON in Rust.
|
||||||
The first method parses block JSON as a block using the parse method from the json crate. It then unwraps the parsed JSON.
|
The first method parses block JSON as a block using the parse method from the json crate. It then unwraps the parsed JSON.
|
||||||
The second method instantiates an object as JSON using the object macro. Key value relationships are easily set using `=>`.
|
The second method instantiates an object as JSON using the object macro. Key value relationships are easily set using `=>`.
|
||||||
After demonstrating two simple ways to write JSON, the assert_eq macro ensures equivalence.
|
|
||||||
|
After demonstrating two simple ways to write JSON, the `assert_eq!` macro ensures equivalence.
|
||||||
|
|
||||||
[![json][json-badge]][json]
|
[![json][json-badge]][json]
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue