Skip to content

Commit

Permalink
Merge pull request #1080 from daerich/array-typo
Browse files Browse the repository at this point in the history
array-expr.md: fix typo; 'polish' sentence
  • Loading branch information
ehuss authored Jul 28, 2021
2 parents 3b7be07 + 9dd6a1f commit 4ac12f6
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 4ac12f6

Please sign in to comment.