Rust: Create editable CLI input

Viewed 32

To read user input in rust, we can do this:

use std::io;
let mut input = String::new();
print!("Edit username: ");
io::stdout().flush().ok();
io::stdin().readline(&mut input);

What I want is a way to create editable input text, like filling the stdin with some text that the user can edit. Something like this:

  stdout              stdin
     |                  |
Edit username: <existing username>
0 Answers
Related