mirror of
https://github.com/rust-lang-nursery/rust-cookbook
synced 2024-11-27 22:00:17 +00:00
No description
src | ||
tests | ||
.gitignore | ||
build.rs | ||
Cargo.lock | ||
Cargo.toml | ||
README.md |
#JSON
##JSON implementation in Rust:
#[macro_use]
extern crate json;
fn main() {
let parsed = json::parse(r#"
{
"code": 200,
"success": true,
"payload": {
"features": [
"awesome",
"easyAPI",
"lowLearningCurve"
]
}
}
"#).unwrap();
let instantiated = object!{
"code" => 200,
"success" => true,
"payload" => object!{
"features" => array![
"awesome",
"easyAPI",
"lowLearningCurve"
]
}
};
assert_eq!(parsed, instantiated);
}
License
MIT/Apache-2.0