Skip to content

Commit fcc3563

Browse files
committed
Remove extraneous [], replace accidental removed link to heap section
1 parent 3a6dbb3 commit fcc3563

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

src/doc/book/ownership.md

+6-6
Original file line numberDiff line numberDiff line change
@@ -51,21 +51,21 @@ fn foo() {
5151
}
5252
```
5353

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
5757
heap-allocated memory. This happens deterministically, at the end of the scope.
5858

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
6060
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
6262
elements onto them.
6363

6464
Vectors have a [generic type][generics] `Vec<T>`, so in this example `v` will have type
6565
`Vec<i32>`. We'll cover generics in detail later in this chapter.
6666

6767
[arrays]: primitive-types.html#arrays
68-
[vector]: vectors.html
68+
[vectors]: vectors.html
6969
[heap]: the-stack-and-the-heap.html
7070
[bindings]: variable-bindings.html
7171
[generics]: generics.html

src/doc/book/primitive-types.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ variable binding. Slices have a defined length, can be mutable or immutable.
167167
## Slicing syntax
168168

169169
You can use a combo of `&` and `[]` to create a slice from various things. The
170-
`&` indicates that slices are similar to [references][], which we will cover in
170+
`&` indicates that slices are similar to [references], which we will cover in
171171
detail later in this section. The `[]`s, with a range, let you define the
172172
length of the slice:
173173

@@ -194,7 +194,7 @@ documentation][slice].
194194
Rust’s `str` type is the most primitive string type. As an [unsized type][dst],
195195
it’s not very useful by itself, but becomes useful when placed behind a
196196
reference, like `&str`. We'll elaborate further when we cover
197-
[Strings][strings] and [references][].
197+
[Strings][strings] and [references].
198198

199199
[dst]: unsized-types.html
200200
[strings]: strings.html

0 commit comments

Comments
 (0)