Divide by zero panick in function
examples/errors/divide-by-zero-panick/src/main.rs
fn div(a: i32, b: i32) -> i32 { a / b } fn main() { for number in [2, 4, 0, 20] { let res = div(100, number); dbg!(res); } }
fn div(a: i32, b: i32) -> i32 { a / b } fn main() { for number in [2, 4, 0, 20] { let res = div(100, number); dbg!(res); } }