From 7045f99aa63abe07d7a550b1563f507a53ecda0d Mon Sep 17 00:00:00 2001 From: Sarah Jamie Lewis Date: Fri, 20 Jan 2023 08:07:06 -0800 Subject: [PATCH] Formatting Fixes --- src/main.rs | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/main.rs b/src/main.rs index 23c1a6f..85c3998 100644 --- a/src/main.rs +++ b/src/main.rs @@ -14,6 +14,8 @@ pub struct QemuProcess { len: usize, } +const DEBUG : bool = false; + /// Pipe streams are blocking, we need separate threads to monitor them without blocking the primary thread. fn child_stream_to_vec(stream: R) -> Arc>> where @@ -121,7 +123,7 @@ impl QemuProcess { let current_length = stdout.len(); if current_length > last_length { - if output { + if DEBUG { println!("{}", tbd); std::io::stdout().flush().expect("could not flush output"); } @@ -129,6 +131,9 @@ impl QemuProcess { // Update length last_length = current_length; + print!("."); + std::io::stdout().flush().expect("could not flush output"); + if last.contains("root@debian:") { let mut cleaned_lines = vec![]; println!(". \x1b[1;32mOK\x1b[0m"); @@ -205,12 +210,12 @@ impl QemuProcess { // The output is wrapped in a Result to allow matching on errors // Returns an Iterator to the Reader of the lines of the file. -fn read_lines

(filename: P) -> std::io::Result>> +fn read_lines

(filename: P) -> std::io::Result>> where P: AsRef, { let file = File::open(filename)?; - Ok(std::io::BufReader::new(file).lines()) + Ok(BufReader::new(file).lines()) } fn main() {