-
Notifications
You must be signed in to change notification settings - Fork 12.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
auto merge of #17962 : jkleint/rust/guide-vectors, r=steveklabnik
The array is the fundamental concept; vectors are growable arrays, and slices are views into either. Show common array ops up front: length and iteration. Mention arrays are immutable by default. Highlight definite initialization and bounds-checking as safety features. Show that you only need a type suffix on one element of initializers. Explain that vectors are a value-add library type over arrays, not a fundamental type; show they have the same "interface." Motivate slices as efficient views into arrays; explain you can slice vectors, Strings, &str because they're backed by arrays. Show off new, easy-to-read [a..b] slice syntax.
- Loading branch information
Showing
1 changed file
with
65 additions
and
50 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters