Skip to content

Commit

Permalink
auto merge of #10721 : osa1/rust/intermediatestr, r=brson
Browse files Browse the repository at this point in the history
as recommended by @huonw on this PR #10711 , I removed intermediate step that generates a string instead of directly writing to Writer without generating intermediate string.
  • Loading branch information
bors committed Dec 6, 2013
2 parents 6e5c5a6 + bc42358 commit 9fc4806
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/librustdoc/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,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);
}

0 comments on commit 9fc4806

Please sign in to comment.