How do I match enum values with an integer?

I can get an integer value of an enums like this: enum MyEnum { A = 1, B, C, } let x = MyEnum::C as i32; but I can't seem to do this: match x { MyEnum::A => {} MyEnum::B ...