📅  最后修改于: 2022-03-11 14:49:25.880000             🧑  作者: Mango
let my_u8: u8 = "42".parse::().unwrap();
let my_u32: u32 = "42".parse::().unwrap();
// or, to be safe, match the `Err`
match "foobar".parse::() {
Ok(n) => do_something_with(n),
Err(e) => weep_and_moan(),
}