printer: accept any Write as output

This commit is contained in:
Tom Milligan authored and David Peter committed 2019-07-17 19:31:37 +02:00
1 parent ca8970b5cc
commit 4c48eedb18
2 files changed
+15 -13

No files matched your search

+3 -1
View File
@@ -118,7 +118,9 @@ fn run() -> Result<(), Box<dyn std::error::Error>> {
.expect("Error setting Ctrl-C handler");
let stdout = io::stdout();
let mut printer = Printer::new(stdout.lock(), show_color, border_style, squeeze);
let mut stdout_lock = stdout.lock();
let mut printer = Printer::new(&mut stdout_lock, show_color, border_style, squeeze);
let mut buffer = [0; BUFFER_SIZE];
'mainloop: loop {