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>> {
|
fn main() -> Result<(), Box<dyn Error>> {
|
||||||
let mut input = String::new();
|
let mut input = String::new();
|
||||||
|
|
||||||
println!("Please input: ");
|
print!("Please input: ");
|
||||||
// io::stdout().flush().ok();
|
io::stdout().flush().ok();
|
||||||
io::stdin().read_line(&mut input)?;
|
io::stdin().read_line(&mut input)?;
|
||||||
|
|
||||||
println!("You typed: {}", input.trim());
|
println!("You typed: {}", input.trim());
|
||||||
|
|||||||
Reference in New Issue
Block a user