Loading tutorials
let bindings, println!). It also assumes you know the Option and Result enums and the basics of ownership and borrowing. You do not need to know if let, let else, or let chains yet. The rest of the tutorial covers them.3 min readOption and Result enums, and match with simple patterns. It explains the one distinction that decides where if let, while let, and let else are allowed. Later chapters build on it.2 min readOption and Result, how match works, and the basics of ownership and borrowing. Here you will learn how if let replaces a match that cares about only one case.3 min readOption and Result, can read a basic match, and have seen plain if let from the previous chapter. It covers what happens when the pattern does not match, and how to chain several patterns in a row.2 min readOption and Result, the match expression, basic patterns, and the basics of ownership and borrowing. It also assumes you have seen if let, which runs a block once when a pattern matches.3 min readOption, match, and the basics of ownership and borrowing. It covers what happens to the names and values that a pattern introduces. These details cause most of the borrow-checker errors people hit with if let and let else.2 min readOption and Result, match, and the difference between refutable and irrefutable patterns from earlier chapters. It also assumes you have used if let. let else needs Rust 1.65 or newer. Unlike let chains, it needs no special edition.2 min readOption and Result, basic match, and the difference between refutable and irrefutable patterns. You will see why the else block of a let else statement must never finish normally, which constructs satisfy that rule, and what the compiler says when you break it.2 min readOption and Result, match, and the basics of if let. It shows what goes wrong when several if let checks depend on each other. The next chapters on let else and let chains fix that problem.3 min readOption and Result, basic match, and how if let binds a name inside its block. It covers let chains, which let one if or while combine several pattern matches and boolean tests.3 min readif let, while let, and let else, and that you know what a Cargo project and Cargo.toml are. Most of these constructs work on any modern compiler. Let chains are the exception, because they need both a recent compiler and a specific edition.2 min readif let ... else, ownership and borrowing, and how Drop and MutexGuard work. It covers one behavior change that edition 2024 made to if let. Your code compiles the same way, but values can be dropped at a different moment.2 min readOption and Result, basic match, and borrowing. It also assumes you have seen each construct from the earlier chapters. Here you will pick one for a given piece of code.2 min read