3 More complex types
This chapter covers
- Arrays—simple, fast, immutable collections of the same type
- Vectors—similar to arrays but growable and with more functionality
- Tuples (a grouping of various types)
- Control flow—making your code run differently depending on the situation
We’re now moving past Rust’s simplest types to collection types. Rust has a lot of collection types, and in this chapter, we’ll learn three of them: arrays, vectors, and tuples. Unsurprisingly, Rust gives you a lot of options to choose from; this chapter only shows a few. After collection types, we’ll learn about control flow, which means telling Rust how to run your code depending on the situation. One of the coolest parts of control flow in Rust is the keyword match ...
Get Learn Rust in a Month of Lunches now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.