You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A *closure expression*, also know as a lambda expression or a lambda, defines a [closure type] and evaluates to a value of that type.
16
16
The syntax for a closure expression is an optional `move` keyword, then a pipe-symbol-delimited (`|`) comma-separated list of [patterns], called the *closure parameters* each optionally followed by a `:` and a type, then an optional `->` and type, called the *return type*, and then an expression, called the *closure body operand*.
@@ -59,7 +59,7 @@ Attributes on closure parameters follow the same rules and restrictions as [regu
Copy file name to clipboardExpand all lines: src/expressions/loop-expr.md
+1-2
Original file line number
Diff line number
Diff line change
@@ -62,7 +62,7 @@ while i < 10 {
62
62
63
63
> **<sup>Syntax</sup>**\
64
64
> [_PredicatePatternLoopExpression_] :\
65
-
> `while``let`[_MatchArmPatterns_]`=`[_Expression_]<sub>_except struct or lazy boolean operator expression_</sub>
65
+
> `while``let`[_Pattern_]`=`[_Expression_]<sub>_except struct or lazy boolean operator expression_</sub>
66
66
> [_BlockExpression_]
67
67
68
68
A `while let` loop is semantically similar to a `while` loop but in place of a condition expression it expects the keyword `let` followed by a pattern, an `=`, a [scrutinee] expression and a block expression.
@@ -263,7 +263,6 @@ In the case a `loop` has an associated `break`, it is not considered diverging,
0 commit comments