Skip to content

Commit 1f4cd80

Browse files
committed
Mention array sugar in guide
1 parent 3f8da69 commit 1f4cd80

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/doc/guide.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1507,6 +1507,7 @@ You can create an array with just square brackets:
15071507

15081508
```{rust}
15091509
let nums = [1i, 2i, 3i];
1510+
let nums = [1i, ..20]; // Shorthand for an array of 20 elements all initialized to 1
15101511
```
15111512

15121513
So what's the difference? An array has a fixed size, so you can't add or

0 commit comments

Comments
 (0)