Skip to content

Commit

Permalink
array-expr.md: Fix typo;'polished' sentence
Browse files Browse the repository at this point in the history
  • Loading branch information
DaErich committed Jul 28, 2021
1 parent 3b7be07 commit 9dd6a1f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/expressions/array-expr.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ The syntax for the second form is two expressions separated by a semicolon (`;`)
The expression before the `;` is called the *repeat operand*.
The expression after the `;` is called the *length operand*.
It must have type `usize` and be a [constant expression], such as a [literal] or a [constant item].
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.
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.
That is, `[a; b]` creates an array containing `b` copies of the value of `a`.
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.

Expand Down

0 comments on commit 9dd6a1f

Please sign in to comment.