Exercise 1 · Chapter: Enums & Pattern MatchingRequired+50 XP
Traffic Light
Define an enum called TrafficLight with three variants: Red, Yellow, and Green.
Create a variable set to TrafficLight::Red and use match to print:
Red=> StopYellow=> Slow downGreen=> Go
Expected output:
Stop
rust
fn main() {
}
Output
Run your code to see the output here.