NEXKT6MR4SNH445ZRPAI44IRQWKTNGGW5XCEZZMZ3ZPXGDZF3ZWQC
pub fn divide(a: i32, b: i32) -> Result<i32, DivisionError> {}
pub fn divide(a: i32, b: i32) -> Result<i32, DivisionError> {
match (a, b) {
(_, 0) => Err(DivisionError::DivideByZero),
(0, _) => Ok(0),
_ => if a % b == 0 {
Ok(a / b)
} else {
Err(DivisionError::NotDivisible(
NotDivisibleError {
dividend: a,
divisor: b
}
))
}
}
}