Ensure diagnostics are printed in the correct order
Even when buffered. Ideally we would flush only when the emitter is done, but that requires larger changes. This gives most of the benefit of buffering in any case.
This commit is contained in:
parent
7ac4154643
commit
ee064befa0
1 changed files with 4 additions and 2 deletions
|
@ -104,7 +104,8 @@ impl Emitter for JsonEmitter {
|
|||
writeln!(&mut self.dst, "{}", as_pretty_json(&data))
|
||||
} else {
|
||||
writeln!(&mut self.dst, "{}", as_json(&data))
|
||||
};
|
||||
}
|
||||
.and_then(|_| self.dst.flush());
|
||||
if let Err(e) = result {
|
||||
panic!("failed to print diagnostics: {:?}", e);
|
||||
}
|
||||
|
@ -116,7 +117,8 @@ impl Emitter for JsonEmitter {
|
|||
writeln!(&mut self.dst, "{}", as_pretty_json(&data))
|
||||
} else {
|
||||
writeln!(&mut self.dst, "{}", as_json(&data))
|
||||
};
|
||||
}
|
||||
.and_then(|_| self.dst.flush());
|
||||
if let Err(e) = result {
|
||||
panic!("failed to print notification: {:?}", e);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue