diff options
| author | Huon Wilson <dbau.pp+github@gmail.com> | 2014-02-17 22:53:45 +1100 |
|---|---|---|
| committer | Huon Wilson <dbau.pp+github@gmail.com> | 2014-02-18 08:05:35 +1100 |
| commit | 6555b04dd2fbcd18c8fa8beb2bebc4b81febc6b0 (patch) | |
| tree | 67b79727570ea14a3b0520b5562aa9e1fba154f9 /src/libextra/json.rs | |
| parent | c8489069b43191c5298f17430933b3b88fb79c3c (diff) | |
Spellcheck library docs.
Diffstat (limited to 'src/libextra/json.rs')
| -rw-r--r-- | src/libextra/json.rs | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/libextra/json.rs b/src/libextra/json.rs index 4c6cd4218e7..edf5bb63b30 100644 --- a/src/libextra/json.rs +++ b/src/libextra/json.rs @@ -125,7 +125,7 @@ fn main() { } ``` -To decode a json string using `Decodable` trait : +To decode a JSON string using `Decodable` trait : ```rust extern crate serialize; @@ -172,7 +172,7 @@ fn main() { {data_int: 1, data_str:~"toto", data_vector:~[2,3,4,5]}; let encoded_str: ~str = json::Encoder::str_encode(&to_encode_object); - // To unserialize use the `extra::json::from_str` and `extra::json::Decoder` + // To deserialize use the `extra::json::from_str` and `extra::json::Decoder` let json_object = extra::json::from_str(encoded_str); let mut decoder = json::Decoder::new(json_object.unwrap()); @@ -182,7 +182,7 @@ fn main() { ## Using `ToJson` -This example use the ToJson impl to unserialize the json string. +This example use the ToJson impl to deserialize the JSON string. Example of `ToJson` trait implementation for TestStruct1. ```rust @@ -212,13 +212,13 @@ impl ToJson for TestStruct1 { } fn main() { - // Seralization using our impl of to_json + // Serialization using our impl of to_json let test2: TestStruct1 = TestStruct1 {data_int: 1, data_str:~"toto", data_vector:~[2,3,4,5]}; let tjson: json::Json = test2.to_json(); let json_str: ~str = tjson.to_str(); - // Unserialize like before. + // Deserialize like before. let mut decoder = json::Decoder::new(json::from_str(json_str).unwrap()); // create the final object |
