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.
writeln!(&mut self.dst, "{}", as_pretty_json(&data))
} else {
writeln!(&mut self.dst, "{}", as_json(&data))
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);
}
if let Err(e) = result {
panic!("failed to print diagnostics: {:?}", e);
}
writeln!(&mut self.dst, "{}", as_pretty_json(&data))
} else {
writeln!(&mut self.dst, "{}", as_json(&data))
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);
}
if let Err(e) = result {
panic!("failed to print notification: {:?}", e);
}