We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 750f2c6 commit 770f0e9Copy full SHA for 770f0e9
src/doc/reference.md
@@ -3064,6 +3064,17 @@ of a condition expression it expects a refutable let statement. If the value of
3064
expression on the right hand side of the let statement matches the pattern, the corresponding
3065
block will execute, otherwise flow proceeds to the first `else` block that follows.
3066
3067
+```
3068
+let dish = ("Ham", "Eggs");
3069
+if let ("Bacon", b) = dish { // will not execute because let is refuted
3070
+ println!("Bacon is served with {}", b);
3071
+}
3072
+
3073
+if let ("Ham", b) = dish { // will execute
3074
+ println!("Ham is served with {}", b);
3075
3076
3077
3078
### While let loops
3079
3080
A `while let` loop is semantically identical to a `while` loop but in place of a
0 commit comments