Function prompt_line

Source
pub fn prompt_line<T: FromStr>(prompt: &str) -> Option<T>
Expand description

Prompts the user (without a newline) to input a value.

ยงExamples

let input = akshually::io::prompt_line::<u8>("Your age: ");
match input {
    Some(age) => {
        println!("You are {age} years old.");
    },
    None => {
        println!("You didn't enter an age.");
    },
};