@@ -51,21 +51,21 @@ fn foo() {
51
51
}
52
52
```
53
53
54
- When ` v ` comes into scope, a new [ vector] [ ] is created, and it allocates space
55
- on the heap for each of its elements. When ` v ` goes out of scope at the end of
56
- ` foo() ` , Rust will clean up everything related to the vector, even the
54
+ When ` v ` comes into scope, a new [ vector] is created, and it allocates space on
55
+ [ the heap] [ heap ] for each of its elements. When ` v ` goes out of scope at the
56
+ end of ` foo() ` , Rust will clean up everything related to the vector, even the
57
57
heap-allocated memory. This happens deterministically, at the end of the scope.
58
58
59
- We'll cover [ vectors] [ vector ] in detail later in this chapter; we only use them
59
+ We'll cover [ vectors] in detail later in this chapter; we only use them
60
60
here as an example of a type that allocates space on the heap at runtime. They
61
- behave like [ arrays] [ ] , except their size may change by ` push() ` ing more
61
+ behave like [ arrays] , except their size may change by ` push() ` ing more
62
62
elements onto them.
63
63
64
64
Vectors have a [ generic type] [ generics ] ` Vec<T> ` , so in this example ` v ` will have type
65
65
` Vec<i32> ` . We'll cover generics in detail later in this chapter.
66
66
67
67
[ arrays ] : primitive-types.html#arrays
68
- [ vector ] : vectors.html
68
+ [ vectors ] : vectors.html
69
69
[ heap ] : the-stack-and-the-heap.html
70
70
[ bindings ] : variable-bindings.html
71
71
[ generics ] : generics.html
0 commit comments