June 2021
Beginner
344 pages
8h 9m
English
The bouncer would like even more functionality. They’d like to know how to treat different visitors and if they can drink alcohol. The final set of improvements to the visitor list are:
Store an action associated with a visitor: admit them, admit them with a note, refuse entry, or mark them as probationary treehouse members.
Store the visitor’s age, and forbid them from drinking if they’re under 21.
Rust lets you define a type that can only be equal to one of a set of predefined values. These are known as enumerations, and are declared with the enum keyword. You are going to define an enumeration listing each of the four actions associated with a visitor. Rust enumerations are very powerful, and can ...
Read now
Unlock full access