Guides

The Rust Expression Guide

22 modules

  1. 1. Expression-Oriented Rust
  2. 2. Transforming Values with map
  3. 3. Chaining Computation with and_then
  4. 4. Converting Option into Result with ok_or_else
  5. 5. Reshaping Errors with Result Combinators
  6. 6. Writing Straight-Line Fallible Code with ?
  7. 7. Choosing match on Purpose
  8. 8. Flattening Control Flow with if let and let-else
  9. 9. Filtering and Transforming with filter_map
  10. 10. Collecting Iterator Pipelines with collect
  11. 11. Finding and Short-Circuiting with Iterator Methods
  12. 12. Flattening and Expanding with flatten and flat_map
  13. 13. Aggregating Data with fold
  14. 14. Coordinating Iteration with enumerate and zip
  15. 15. Writing Clear Conditions and Predicates
  16. 16. Choosing Between Loops and Iterator Chains
  17. 17. Refactoring Away Temporary Variables
  18. 18. Shrinking and Isolating Error Paths
  19. 19. Keeping the Happy Path Obvious
  20. 20. Avoiding Clever-Looking Rust
  21. 21. Refactoring Verbose Rust into Idiomatic Expressions
  22. 22. Refactoring Dense Rust into Clear Rust