We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent e0ec4ff commit b72f365Copy full SHA for b72f365
src/librustc_save_analysis/json_dumper.rs
@@ -29,16 +29,8 @@ pub struct WriteOutput<'b, W: Write> {
29
30
impl<'b, W: Write> DumpOutput for WriteOutput<'b, W> {
31
fn dump(&mut self, result: &Analysis) {
32
- let json = match serde_json::to_string(result) {
33
- Ok(json) => json,
34
- Err(e) => {
35
- error!("Can't serialize save-analysis: {}", e);
36
- return;
37
- }
38
- };
39
-
40
- if let Err(e) = write!(self.output, "{}", json) {
41
- error!("Error writing save-analysis: {:?}", e);
+ if let Err(e) = serde_json::to_writer(self.output.by_ref(), result) {
+ error!("Can't serialize save-analysis: {:?}", e);
42
}
43
44
0 commit comments