inputparser
Note: Thanks to @Restioson, @ThatsNoMoon and @kangalioo for helping me write the code
Now Rust inputs are almost as simple as Python
Terminal inputs are now easier than ever. Replacing over 5 lines of codes with just 1 function.
Supports all formats that FromStr Supports
Instead of
let mut var: String = String new;
stdin.read_line.unwrap;
let var: i32 = var.trim.parse.unwrap;
why not
let var: i32 = input;
and it doesn't panic when wrong format is entered (when default arg [Def]).
Or you can choose to make it panic too.
Usage
[]
= "0.1"
Example
extern crate inputparser;
use ;