luleyleo/druid-enum-helpers

Wildcard arms should represent the raw enum insead of ()

luleyleo opened this issue · 0 comments

fn event_widget() -> impl Widget<Event> {
    match_widget! { Event,
        Event::Click(u32, u32) => Label::dynamic(|data, _| {
            format!("x: {}, y: {}", data.0, data.1)
        }),
        _ => Label::dynamic(|data: &Event, _| format!("key: unhandled"))), // <- THIS
        _ => Label::dynamic(|data: &(), _| format!("key: unhandled"))), // <- NOT THIS
    }
}