#![feature(plugin)]
#![plugin(json_macros)]
#[cfg(feature="with-rustc-serialize")]
extern crate rustc_serialize;
#[cfg(feature="with-serde")]
extern crate serde_json;
#[cfg(feature="with-rustc-serialize")]
fn make_pretty_json(x: i32) -> String {
json!({ "foo": "foooooo", "bar": [true, null, 123, 123.4], "quux": { "a": [1, 2, 3, 4],
"b": { "a": null },
"c": false
},
"waldo": (192 - x) }).pretty().to_string()
}
#[cfg(feature="with-serde")]
fn make_pretty_json(x: i32) -> String {
serde_json::to_string_pretty(&json!({ "foo": "foooooo", "bar": [true, null, 123, 123.4], "quux": { "a": [1, 2, 3, 4],
"b": { "a": null },
"c": false
},
"waldo": (192 - x) })).unwrap()
}
pub fn main() {
println!("{}", make_pretty_json(1));
}