]> git.lizzy.rs Git - rust.git/commitdiff
Mention array sugar in guide
authorManish Goregaokar <manishsmail@gmail.com>
Thu, 25 Sep 2014 18:30:04 +0000 (00:00 +0530)
committerManish Goregaokar <manishsmail@gmail.com>
Thu, 25 Sep 2014 18:30:27 +0000 (00:00 +0530)
src/doc/guide.md

index 6a27cf2f1ef1ffd81ffa1fa329a9acc06ffbdb0f..6abb6c22c018cc6ba63b0ef91e02555839312acb 100644 (file)
@@ -1507,6 +1507,7 @@ You can create an array with just square brackets:
 
 ```{rust}
 let nums = [1i, 2i, 3i];
+let nums = [1i, ..20]; // Shorthand for an array of 20 elements all initialized to 1
 ```
 
 So what's the difference? An array has a fixed size, so you can't add or