Testing Out Enums

Published 322d ago

 cooluser

Enum editing

enum MyEnum {
    TestEnum,
    TestEnumAgain,
}

fn main() {
    let x = MyEnum::TestEnum;
    match x {
        MyEnum::TestEnum => println!("matches test enum once"),
        MyEnum::TestEnumAgain => println!("matches again"),
    };
}

enumstesting
2

Please login or sign up to comment and collaborate