Skip to content

Commit 1b6bd92

Browse files
committed
Rollup merge of #24515 - steveklabnik:gh24070, r=Gankro
Fixes #24070 or rather, fixes it even though it's already been fixed: slices are before now. But the linking is nice anyway.
2 parents 27dc069 + d9515ad commit 1b6bd92

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/doc/trpl/vectors.md

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,18 @@
11
% Vectors
22

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

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

13+
[slices]: primitive-types.html#slices
14+
[string]: strings.html
15+
1116
(Notice that unlike the `println!` macro we've used in the past, we use square
1217
brackets `[]` with `vec!`. Rust allows you to use either in either situation,
1318
this is just convention.)

0 commit comments

Comments
 (0)