Skip to content

Also check or-ed values in a single match arm? #15

@hoijui

Description

@hoijui

In the match, the 4 variants are not ordered (B, E, C, D):

extern crate remain;

#[remain::sorted]
#[derive(Clone, Copy)]
enum My {
    A,
    B,
    C,
    D,
    E,
}

#[remain::check]
fn f(a: My) {
    #[remain::sorted]
    match a {
        My::A => (),
        My::B | My::E | My::C | My::D => (),
    }
}

fn main() {
    f(My::E);
}

PlayGround link

... and thanks for all your cool rust stuff! I am also going through the quiz... wow! :-)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions