add flush
This commit is contained in:
@@ -1,9 +1,9 @@
|
||||
use std::{ io, error::Error, };
|
||||
use std::{ io, io::Write, error::Error, };
|
||||
fn main() -> Result<(), Box<dyn Error>> {
|
||||
let mut input = String::new();
|
||||
|
||||
println!("Please input: ");
|
||||
// io::stdout().flush().ok();
|
||||
print!("Please input: ");
|
||||
io::stdout().flush().ok();
|
||||
io::stdin().read_line(&mut input)?;
|
||||
|
||||
println!("You typed: {}", input.trim());
|
||||
|
||||
Reference in New Issue
Block a user