diff options
| author | Steven Fackler <sfackler@gmail.com> | 2014-02-17 20:43:32 -0800 |
|---|---|---|
| committer | Steven Fackler <sfackler@gmail.com> | 2014-02-18 20:42:29 -0800 |
| commit | 06589136167f3a345920260e1dcb00717b6cd68f (patch) | |
| tree | 4ea08d24eb7b5edc2685e913fc38b0a8f0f638a1 /src/libextra | |
| parent | 03c5342419fe49d060f2ea26f77ae3e716945a90 (diff) | |
| download | rust-06589136167f3a345920260e1dcb00717b6cd68f.tar.gz rust-06589136167f3a345920260e1dcb00717b6cd68f.zip | |
rustdoc: Only inject extern crates if not present
Diffstat (limited to 'src/libextra')
| -rw-r--r-- | src/libextra/json.rs | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/libextra/json.rs b/src/libextra/json.rs index 4c6cd4218e7..12b63255958 100644 --- a/src/libextra/json.rs +++ b/src/libextra/json.rs @@ -59,6 +59,7 @@ the code for these traits: `#[deriving(Decodable, Encodable)]` To encode using Encodable : ```rust +extern crate extra; extern crate serialize; use extra::json; use std::io; @@ -98,6 +99,7 @@ A basic `ToJson` example using a TreeMap of attribute name / attribute value: ```rust +extern crate extra; extern crate collections; use extra::json; @@ -128,6 +130,7 @@ fn main() { To decode a json string using `Decodable` trait : ```rust +extern crate extra; extern crate serialize; use serialize::Decodable; @@ -154,6 +157,7 @@ Create a struct called TestStruct1 and serialize and deserialize it to and from using the serialization API, using the derived serialization code. ```rust +extern crate extra; extern crate serialize; use extra::json; use serialize::{Encodable, Decodable}; @@ -186,6 +190,7 @@ This example use the ToJson impl to unserialize the json string. Example of `ToJson` trait implementation for TestStruct1. ```rust +extern crate extra; extern crate serialize; extern crate collections; |
