-use std::{
- io,
- io::prelude::Write,
- borrow::Cow,
-};
+use std::{borrow::Cow, io, io::prelude::Write};
+use super::OutputFormatter;
use crate::{
- types::TestDesc,
- time,
- test_result::TestResult,
console::{ConsoleTestState, OutputLocation},
+ test_result::TestResult,
+ time,
+ types::TestDesc,
};
-use super::OutputFormatter;
pub(crate) struct JsonFormatter<T> {
out: OutputLocation<T>,
ty, name, evt
))?;
if let Some(exec_time) = exec_time {
- self.write_message(&*format!(
- r#", "exec_time": "{}""#,
- exec_time
- ))?;
+ self.write_message(&*format!(r#", "exec_time": "{}""#, exec_time))?;
}
if let Some(stdout) = stdout {
- self.write_message(&*format!(
- r#", "stdout": "{}""#,
- EscapedString(stdout)
- ))?;
+ self.write_message(&*format!(r#", "stdout": "{}""#, EscapedString(stdout)))?;
}
if let Some(extra) = extra {
- self.write_message(&*format!(
- r#", {}"#,
- extra
- ))?;
+ self.write_message(&*format!(r#", {}"#, extra))?;
}
self.writeln_message(" }")
}