I want to get the first argument as a number, if there is any. This does not feel quite right, but I don't know yet what the Rust way would be.
I'm not searching for a args-framework or something, I just want to get a grip on doing stuff with Rust.
fn limit_from_args(args: env::Args) -> i32 {
let args: Vec<String> = args.collect();
if args.len() > 1 {
match args[1].parse::<i32>() {
Ok(i) => i + 1,
Err(_) => 101,
}
} else {
101
}
}