Skip to content

Commit

Permalink
Rollup merge of rust-lang#24515 - steveklabnik:gh24070, r=Gankro
Browse files Browse the repository at this point in the history
 Fixes rust-lang#24070

or rather, fixes it even though it's already been fixed: slices are before now. But the linking is nice anyway.
  • Loading branch information
Manishearth committed Apr 17, 2015
2 parents 27dc069 + d9515ad commit 1b6bd92
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/doc/trpl/vectors.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,18 @@
% Vectors

A *vector* is a dynamic or "growable" array, implemented as the standard
library type [`Vec<T>`](../std/vec/) (Where `<T>` is a [Generic](./generics.md) statement). Vectors always allocate their data on the heap. Vectors are to slices
what `String` is to `&str`. You can create them with the `vec!` macro:
library type [`Vec<T>`](../std/vec/) (Where `<T>` is a [Generic](./generics.md)
statement). Vectors always allocate their data on the heap. Vectors are to
[slices][slices] what [`String`][string] is to `&str`. You can
create them with the `vec!` macro:

```{rust}
let v = vec![1, 2, 3]; // v: Vec<i32>
```

[slices]: primitive-types.html#slices
[string]: strings.html

(Notice that unlike the `println!` macro we've used in the past, we use square
brackets `[]` with `vec!`. Rust allows you to use either in either situation,
this is just convention.)
Expand Down

0 comments on commit 1b6bd92

Please sign in to comment.