diff --git a/src/main.rs b/src/main.rs index e7a11a9..6e43406 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,3 +1,23 @@ +use std::io; +use std::io::Write; + fn main() { println!("Hello, world!"); + + loop { + let mut input = String::new(); + print!("> "); + + io::stdout() + .flush() + .expect("flush to stdout should not fail"); + + io::stdin() + .read_line(&mut input) + .expect("failed to read line"); + + let output = input.trim(); + + println!("input received: '{output}'"); + } }