Why is field kind
of std::num::ParseIntError
private? I would like to branch on it:
fn main() {
let y = "1000000000000000".parse::<i32>();
match y {
Ok(y) => {println!("{}",y);}
Err(e) => {
match e.kind {
Overflow => {},
_ => {}
}
}
}
}
I know that if you want to write your own parser, a trim/sanitizer/transformation should be run just before s.parse::<i32>()
, as the syntax rules might differ. You don't need to talk about that.