Skip to content

Allow for underscores in match arms #3

@klinvill

Description

@klinvill

It's convenient to use underscores in match arms to both concisely capture the remaining arms, as well as to avoid naming variables that won't be used. For example, the following match statement should be supported for options:

#[define]
fn is_some<T>(v: Option<T>) -> bool {
    match v {
        Option::Some(_) => true,
        _ => false,
}

Underscores are used both in place of variables that don't matter (Some(_)) as well as to capture remaining match arms (_ => false).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions