Summary
In this chapter, we saw how Rust deals with some fairly complex types that allow us to create a type which contains many different types, and how handling these compound types can be a mostly painless affair. We have also drawn attention to pitfalls when using enums.
We have examined the structured and flexible approach Rust takes to patterns and matching and the power that simplicity provides to developers.
In the next chapter, we will be looking at something that takes a fair bit of practice to understand and even more to get right—the Rust lifetime system.