Skip to content

Commit

Permalink
rustdoc-json: Time serialization.
Browse files Browse the repository at this point in the history
  • Loading branch information
aDotInTheVoid committed Apr 26, 2023
1 parent ae3ab14 commit 2b7dd08
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/librustdoc/json/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,10 @@ impl<'tcx> FormatRenderer<'tcx> for JsonRenderer<'tcx> {
p.push(output.index.get(&output.root).unwrap().name.clone().unwrap());
p.set_extension("json");
let mut file = BufWriter::new(try_err!(File::create(&p), p));
serde_json::ser::to_writer(&mut file, &output).unwrap();
self.tcx
.sess
.time("rustdoc_json_serialization", || serde_json::ser::to_writer(&mut file, &output))
.unwrap();
try_err!(file.flush(), p);

Ok(())
Expand Down

0 comments on commit 2b7dd08

Please sign in to comment.