Input Universal Input Validation
Prompts the user for input and parses to the value of the type requested. If an incorrect response is provided the user will be prompted again until they give a proper response.
Installation
To use this crate in your project, either add input_validation
your Cargo.toml
file or run 'cargo add input_validation`.
Usage
use ;
Example Output
What is your name? 4
Hello, 4
What is your age? John Smith
What is your age? 43
Your are 43 years old.
Are you cool? k
Are you cool? Y
You are cool!
What is your favorite fruit? apple
What is your favorite fruit? apples
Your favorite fruit is: Apples
Enter some names, separated by commas: John Cougar, Fred Flintstone, Mary Cooper, violet beauregarde
You entered:
Enter some numbers, separated by commas: j, k, w, 3
Enter some numbers, separated by commas: 1, 5, 3, 98, 42
You entered:
Enter your email address: john@example.com
Your email address is: john@example.com
Contributing
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.