Closed
Description
If one wants to convert an Encodable
type to a Json
value, then one has to do something like (i.e. encode as JSON to a string and then parse that string):
let foo = something_to_convert_to_json;
let s = do std::io::with_str_writer |w| {
foo.encode(&mut extra::json::Encoder(w));
};
let json = match extra::json::from_str(s) {
Ok(j) => j,
Err(_) => fail!("Rust output some json it doesn't understand itself.")
};
Metadata
Metadata
Assignees
Labels
No labels