input-lib 0.1.0

A basic library for reading input with prompts and parsing.
Documentation
1
2
3
4
5
6
7
8
9
10
use std::num::ParseIntError;
use input_lib::{input, InputError};

fn main() {
    let age: Result<u8, InputError<ParseIntError>> = input!("Enter your age: ");

    let age = age.expect("The age is required, please enter the number");

    println!("Your age is {age}");
}