Result Handling
Level: intro (score: 1)
                🚀 These intro exercises are prep for our
                Rust Intro Cohort Program.
              
            
            🎯 Python has try/except, but Rust takes a different path with Result.
Instead of throwing exceptions, Rust encourages you to return a Result<T, E> where:
- T is the type you return on success (Ok)
 - E is the type you return on failure (Err)
 
This forces you to explicitly handle success and failure cases, making your code safer and more predictable.
✅ Your task:
Implement the divide function which:
- Takes two integers 
aandb - Returns 
Ok(a / b)ifbis not zero - Returns an 
Err(String)with the message"division by zero"ifbis zero 
This exercise introduces:
- The Result enum (Ok and Err variants)
 - Using generics in Result<T, E>
 - Defensive programming in Rust
 
🧠 Remember: in Rust, not handling an error is a compile-time error — it’s part of the language’s safety guarantees.
pub fn divide(a: i32, b: i32) -> Result<i32, String> {
    // your code here
}
#[cfg(test)]
mod tests {
    use super::*;
    #[test]
    fn test_divide_normal() {
        assert_eq!(divide(10, 2), Ok(5));
        assert_eq!(divide(7, 2), Ok(3));
    }
    #[test]
    fn test_divide_zero() {
        assert_eq!(divide(10, 0), Err("division by zero".to_string()));
        assert_eq!(divide(-5, 0), Err("division by zero".to_string()));
    }
}