diff --git a/README.md b/README.md index 8e12720..a8820e1 100644 --- a/README.md +++ b/README.md @@ -75,6 +75,10 @@ A string of JSON data can be parsed into a `serde_json::Value` by the [`from_reader`][from_reader] for parsing from any `io::Read` like a File or a TCP stream. + + + + ```rust extern crate serde_json; @@ -113,6 +117,10 @@ in one of the dozens of places it is used in your code. Serde provides a powerful way of mapping JSON data into Rust data structures largely automatically. + + + + ```rust extern crate serde; extern crate serde_json; @@ -176,6 +184,10 @@ Serde JSON provides a [`json!` macro][macro] to build `serde_json::Value` objects with very natural JSON syntax. In order to use this macro, `serde_json` needs to be imported with the `#[macro_use]` attribute. + + + + ```rust #[macro_use] extern crate serde_json; @@ -206,6 +218,10 @@ be interpolated directly into the JSON value as you are building it. Serde will check at compile time that the value you are interpolating is able to be represented as JSON. + + + + ```rust let full_name = "John Doe"; let age_last_year = 42; @@ -233,6 +249,10 @@ A data structure can be converted to a JSON string by [`serde_json::to_writer`][to_writer] which serializes to any `io::Write` such as a File or a TCP stream. + + + + ```rust extern crate serde; extern crate serde_json;