October 2018
Beginner
180 pages
4h 48m
English
The Rust community tends to prefer using enumerations to address one-variable-multiple-types problems. In terms of runtime cost, a simple enumeration is maximally efficient, and efficiency is important to Rust programmers.
However, there is a downside to using enumerations, which is that the match expressions (or similar) that decide how to handle a particular enumeration value and associated data might be spread throughout the source code of the program. If we discover a need to add or remove an enumeration value, or change an enumeration value's parameters, we have to find and change every one of those match expressions.
If we decide to add a Reverse value to the Drive enumeration, the match expressions have ...
Read now
Unlock full access