Replace match statement with if
Replace match statement with if

rustc doesn’t yet realize that enum variants without explicit
discriminators are constant enough to be used as patterns in a match
statement (https://github.com/rust-lang/rust/issues/23898).

This happens to be what #[derive(FromPrimitive)] does, anyway.

Signed-off-by: Anders Kaseorg <087231934ba8fcf78bc142ce37d193b895ac03c4@mit.edu>

TaborKelly/enum_primitive-rs,pwoolcoc/enum_primitive-rs,andersk/enum_primitive-rs