Skip to content

Commit 9fc4806

Browse files
committed
auto merge of #10721 : osa1/rust/intermediatestr, r=brson
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.
2 parents 6e5c5a6 + bc42358 commit 9fc4806

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

Diff for: src/librustdoc/lib.rs

+2-3
Original file line numberDiff line numberDiff line change
@@ -327,7 +327,6 @@ fn json_output(crate: clean::Crate, res: ~[plugins::PluginJson], dst: Path) {
327327
json.insert(~"crate", crate_json);
328328
json.insert(~"plugins", json::Object(plugins_json));
329329

330-
let mut file = File::create(&dst).unwrap();
331-
let output = json::Object(json).to_str();
332-
file.write(output.as_bytes());
330+
let file = @mut File::create(&dst).unwrap();
331+
json::Object(json).to_writer(file as @mut io::Writer);
333332
}

0 commit comments

Comments
 (0)