11 lines
230 B
Rust
11 lines
230 B
Rust
use std::io::{self, Write};
|
|
|
|
pub fn readline(prompt: &str) -> Result<String, io::Error> {
|
|
print!("{}", prompt);
|
|
io::stdout().flush()?;
|
|
|
|
let mut buf = String::new();
|
|
io::stdin().read_line(&mut buf)?;
|
|
|
|
Ok(buf)
|
|
}
|