diff --git a/examples/hello_world.rs b/examples/hello_world.rs index b31f50f..6871223 100644 --- a/examples/hello_world.rs +++ b/examples/hello_world.rs @@ -7,10 +7,6 @@ fn main() { ) ); if eval.is_err() { - let err = eval.unwrap_err(); - if err == "Stdin closed" { - return - } - eprintln!("Program failed: {}", err); + eprintln!("Program failed: \n{}", eval.unwrap_err()); } } \ No newline at end of file diff --git a/src/lib.rs b/src/lib.rs index 527d9fa..4ebd562 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -119,7 +119,7 @@ pub fn eval_mem(bf_str: &&str, mem: &mut [u8], pointer: &mut usize) -> Result<() if char == ',' { let byte = stdin().bytes().next(); if byte.is_none() { - return Err("Stdin closed".into()); + continue } let byte = byte.unwrap(); if byte.is_err() {