From 8902a6967d7b87685f5d6edd6e9f689606ec4fdd Mon Sep 17 00:00:00 2001 From: Ahurac Date: Tue, 9 Apr 2024 12:18:05 +0200 Subject: [PATCH] main : use std::io --- src/main.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/main.rs b/src/main.rs index 90085a7..0248647 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,3 +1,4 @@ +use std::io; use std::io::Write; fn main() { @@ -6,8 +7,9 @@ fn main() { while bytes_read != 0 { print!("$ "); - std::io::stdout().flush().unwrap(); - bytes_read = std::io::stdin() + io::stdout().flush().unwrap(); + + bytes_read = io::stdin() .read_line(&mut user_input) .expect("error reading user input"); }