3 Code flow
This chapter covers
- Discussing pattern matching
- Handling errors with pattern matching
- Reviewing Rust’s functional programming patterns
We need to continue to review more of Rust’s core language features—its building blocks—before diving into design patterns. In this chapter, we’ll start by discussing pattern matching and functional programming. Pattern matching allows us to control the code flow, unwrap or destructure values, and handle optional cases. Functional programming lets us build software around the unit of a function, which is one of the most basic and easiest-to-understand abstractions.
These building blocks are distinct but can be combined in many ways to create new abstractions. We’ll tie these building blocks ...
Get Idiomatic Rust 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.