From 398eb06581e2fc855182607574261f071c9e04b7 Mon Sep 17 00:00:00 2001 From: Chris Krycho Date: Tue, 26 Nov 2024 15:55:15 -0700 Subject: [PATCH] Very small clarification on if let Fixes #3999 --- src/ch06-03-if-let.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/ch06-03-if-let.md b/src/ch06-03-if-let.md index fee6b2caf3..829d011695 100644 --- a/src/ch06-03-if-let.md +++ b/src/ch06-03-if-let.md @@ -32,8 +32,8 @@ sign. It works the same way as a `match`, where the expression is given to the `match` and the pattern is its first arm. In this case, the pattern is `Some(max)`, and the `max` binds to the value inside the `Some`. We can then use `max` in the body of the `if let` block in the same way we used `max` in -the corresponding `match` arm. The code in the `if let` block isn’t run if the -value doesn’t match the pattern. +the corresponding `match` arm. The code in the `if let` block only runs if the +value matches the pattern. Using `if let` means less typing, less indentation, and less boilerplate code. However, you lose the exhaustive checking that `match` enforces. Choosing