This would be more efficient as:

```rust
let writer = match *ofile {
    // this would preferably be `~Writer`, but extra::json only likes `@mut` at the moment.
    None => @mut io::stdout() as @mut Writer,
    Some(ref out_file) => @mut File::create(out_file) as @mut Writer
};
json::Object(json).to_writer(writer);
```

since that would write directly to stdout/the file rather than having to allocate and *then* dump a potentially large string. (This change to use `.to_writer` should also be done to rustdoc, if you feel like it. :) )