1. 25
    Rustlings enums1: Declaring enums

Rustlings enums1: Declaring enums

Chris Biscardi
InstructorChris Biscardi

Share this video with your friends

Send Tweet
Published 3 years ago
Updated 2 years ago

README for this exercise.

Chris Biscardi: [0:00] In enums1, we have a an empty enum here. An enum in Rust is a type that can be any one of several variant that we define inside of the body of this enum.

[0:09] In this case, our main function provides us with the ones that we have to implement. These are Quit, Echo, Move, and ChangeColor. Because none of the variants in the Message enum take any values, we can declare them in the body of the enum.