1
Fork 0

extra: missed a couple @ in json

This commit is contained in:
Erick Tryzelaar 2013-11-29 21:26:03 -08:00
parent 6818b96a66
commit a7b311ac61
4 changed files with 19 additions and 15 deletions

View file

@ -312,9 +312,12 @@ fn json_output(crate: clean::Crate, res: ~[plugins::PluginJson], dst: Path) {
// FIXME #8335: yuck, Rust -> str -> JSON round trip! No way to .encode
// straight to the Rust JSON representation.
let crate_json_str = {
let w = @mut MemWriter::new();
crate.encode(&mut json::Encoder::init(w as @mut io::Writer));
str::from_utf8(*w.inner_ref())
let mut w = MemWriter::new();
{
let mut encoder = json::Encoder::init(&mut w as &mut io::Writer);
crate.encode(&mut encoder);
}
str::from_utf8_owned(w.inner())
};
let crate_json = match json::from_str(crate_json_str) {
Ok(j) => j,