5. Given this enum and function, what is the output?
enum Event {
Click { x: i32, y: i32 },
KeyPress(char),
Resize(u32, u32),
}
fn describe(event: Event) -> String {
match event {
Event::Click { x, y } if x > 0 && y > 0 => format!("Clicked at positive coords: {}, {}", x, y),
Event::Click { .. } => "Clicked at non-positive coords".to_string(),
Event::KeyPress(c) if c.is_alphabetic() => format!("Key pressed: {}", c),
Event::KeyPress(_) => "Non-alphabetic key pressed".to_string(),
Event::Resize(w, h) if w == h => "Resized to square".to_string(),
Event::Resize(_, _) => "Resized to rectangle".to_string(),
}
}
fn main() {
let e = Event::Resize(100, 100);
println!("{}", describe(e));
}