Skip to content

Commit bc42358

Browse files
committed
don't create intermediate string while creating json (rustdoc)
1 parent 6c672ee commit bc42358

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
@@ -324,7 +324,6 @@ fn json_output(crate: clean::Crate, res: ~[plugins::PluginJson], dst: Path) {
324324
json.insert(~"crate", crate_json);
325325
json.insert(~"plugins", json::Object(plugins_json));
326326

327-
let mut file = File::create(&dst).unwrap();
328-
let output = json::Object(json).to_str();
329-
file.write(output.as_bytes());
327+
let file = @mut File::create(&dst).unwrap();
328+
json::Object(json).to_writer(file as @mut io::Writer);
330329
}

0 commit comments

Comments
 (0)