Rust does not have a switch keyword but the match keyword that works like a switch examples in other languages like Java and C++. Generally, the match can run codes or return a single value. It cannot do both at
Enum Variants And Match Expressions In Rust
There are a few ways to define an enum variant and, as a result, to use it when creating match expressions. We can define a variant in three ways – one-word, Tuple-like, or Struct-like. Match One-Word Enum Variants Let’s say