File: text_simple.rs

package info (click to toggle)
rust-inquire 0.9.4%2Bds-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 7,000 kB
  • sloc: makefile: 2; sh: 1
file content (10 lines) | stat: -rw-r--r-- 254 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
use inquire::Text;

fn main() {
    let name = Text::new("What is your name?").prompt();

    match name {
        Ok(name) => println!("Hello {name}"),
        Err(_) => println!("An error happened when asking for your name, try again later."),
    }
}