-1 is used here as a fallback value, but any error handling instructions can be used. Demo · Doc. Rust. let i: i32 = s.parse().unwrap_or(0); ...
確定! 回上一頁