diff --git a/run.sh b/run.sh index 8c8297f..475b115 100755 --- a/run.sh +++ b/run.sh @@ -1,4 +1,3 @@ #!/bin/bash -cargo make sudoku -rm -rf target \ No newline at end of file +cargo make sudoku && cargo clean \ No newline at end of file diff --git a/src/lib.rs b/src/lib.rs index 5056e4d..65209f0 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -72,8 +72,8 @@ pub fn write_uart(port: &mut Port, data: &[u8]) -> Result<()> { port.name().expect("Failed to get Uart Name") ); match port.write(data) { - Ok(len) => { - debug!("Wrote {} bytes!", len); + Ok(_) => { + debug!("Wrote {} bytes!", str::from_utf8(data)?); } Err(_) => { bail!("Unable to Write to Uart"); diff --git a/src/sudoku_avr.rs b/src/sudoku_avr.rs index bfe89f0..3416e14 100644 --- a/src/sudoku_avr.rs +++ b/src/sudoku_avr.rs @@ -5,6 +5,7 @@ use rand::{thread_rng, Rng}; use std::fs::{create_dir, OpenOptions}; use std::io::{ErrorKind, Write}; use std::path::PathBuf; +use std::str; use std::thread; use std::time::Duration; use strum_macros::{Display, EnumIter, EnumString}; @@ -321,8 +322,8 @@ impl SudokuAvr { match port.write(chunk) { Ok(_) => { debug!( - "Wrote {:?} to {:?}", - chunk, + "Wrote {} to {:?}", + str::from_utf8(chunk)?, port.name().expect("Failed to get UART Name") ); port.flush().expect("Unable to Flush!");