@@ -125,7 +125,7 @@ fn main() {
125
125
}
126
126
```
127
127
128
- To decode a json string using `Decodable` trait :
128
+ To decode a JSON string using `Decodable` trait :
129
129
130
130
```rust
131
131
extern crate serialize;
@@ -172,7 +172,7 @@ fn main() {
172
172
{data_int: 1, data_str:~"toto", data_vector:~[2,3,4,5]};
173
173
let encoded_str: ~str = json::Encoder::str_encode(&to_encode_object);
174
174
175
- // To unserialize use the `extra::json::from_str` and `extra::json::Decoder`
175
+ // To deserialize use the `extra::json::from_str` and `extra::json::Decoder`
176
176
177
177
let json_object = extra::json::from_str(encoded_str);
178
178
let mut decoder = json::Decoder::new(json_object.unwrap());
@@ -182,7 +182,7 @@ fn main() {
182
182
183
183
## Using `ToJson`
184
184
185
- This example use the ToJson impl to unserialize the json string.
185
+ This example use the ToJson impl to deserialize the JSON string.
186
186
Example of `ToJson` trait implementation for TestStruct1.
187
187
188
188
```rust
@@ -212,13 +212,13 @@ impl ToJson for TestStruct1 {
212
212
}
213
213
214
214
fn main() {
215
- // Seralization using our impl of to_json
215
+ // Serialization using our impl of to_json
216
216
217
217
let test2: TestStruct1 = TestStruct1 {data_int: 1, data_str:~"toto", data_vector:~[2,3,4,5]};
218
218
let tjson: json::Json = test2.to_json();
219
219
let json_str: ~str = tjson.to_str();
220
220
221
- // Unserialize like before.
221
+ // Deserialize like before.
222
222
223
223
let mut decoder = json::Decoder::new(json::from_str(json_str).unwrap());
224
224
// create the final object
0 commit comments