Add output for machines

This commit is contained in:
Chaoscaot
2023-04-04 22:38:02 +02:00
parent 64158cf45b
commit 80eeaad5d5
3 changed files with 62 additions and 4 deletions

View File

@@ -49,8 +49,8 @@ impl FromStr for OutputSink {
impl OutputSink {
pub fn output(&self) -> Box<dyn Write> {
match self {
OutputSink::Stdout => Box::new(std::io::stdout().lock()),
OutputSink::Stderr => Box::new(std::io::stderr().lock()),
OutputSink::Stdout => Box::new(std::io::stdout()),
OutputSink::Stderr => Box::new(std::io::stderr()),
OutputSink::File(path) => Box::new(BufWriter::new(File::create(path).unwrap()))
}
}