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
Copy file name to clipboardExpand all lines: src/expressions/array-expr.md
+1-1
Original file line number
Diff line number
Diff line change
@@ -21,7 +21,7 @@ The syntax for the second form is two expressions separated by a semicolon (`;`)
21
21
The expression before the `;` is called the *repeat operand*.
22
22
The expression after the `;` is called the *length operand*.
23
23
It must have type `usize` and be a [constant expression], such as a [literal] or a [constant item].
24
-
An array expression of this form creates an array with the length of the value of the legnth operand with each element a copy of the repeat operand.
24
+
An array expression of this form creates an array with the length of the value of the length operand with each element being a copy of the repeat operand.
25
25
That is, `[a; b]` creates an array containing `b` copies of the value of `a`.
26
26
If the length operand has a value greater than 1 then this requires that the type of the repeat operand is [`Copy`] or that it must be a [path] to a constant item.
0 commit comments