From bc423583a4a31d54fb35e728f1a464da0915f2e6 Mon Sep 17 00:00:00 2001 From: osa1 Date: Fri, 29 Nov 2013 10:06:21 +0200 Subject: [PATCH] don't create intermediate string while creating json (rustdoc) --- src/librustdoc/lib.rs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/librustdoc/lib.rs b/src/librustdoc/lib.rs index c5b2125c163c4..26450ead73982 100644 --- a/src/librustdoc/lib.rs +++ b/src/librustdoc/lib.rs @@ -324,7 +324,6 @@ fn json_output(crate: clean::Crate, res: ~[plugins::PluginJson], dst: Path) { json.insert(~"crate", crate_json); json.insert(~"plugins", json::Object(plugins_json)); - let mut file = File::create(&dst).unwrap(); - let output = json::Object(json).to_str(); - file.write(output.as_bytes()); + let file = @mut File::create(&dst).unwrap(); + json::Object(json).to_writer(file as @mut io::Writer); }