Skip to content

Commit 06e2e0e

Browse files
committed
Use v instead of v1 for consistency
The code examples and previous paragraphs all use `v` and `v2`
1 parent 6fa61b8 commit 06e2e0e

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/doc/book/ownership.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -173,11 +173,11 @@ For example if we truncated the vector to just two elements through `v2`:
173173
v2.truncate(2);
174174
```
175175

176-
and `v1` were still accessible we'd end up with an invalid vector since `v1`
176+
and `v` were still accessible we'd end up with an invalid vector since `v`
177177
would not know that the heap data has been truncated. Now, the part of the
178-
vector `v1` on the stack does not agree with the corresponding part on the
179-
heap. `v1` still thinks there are three elements in the vector and will
180-
happily let us access the non existent element `v1[2]` but as you might
178+
vector `v` on the stack does not agree with the corresponding part on the
179+
heap. `v` still thinks there are three elements in the vector and will
180+
happily let us access the non existent element `v[2]` but as you might
181181
already know this is a recipe for disaster. Especially because it might lead
182182
to a segmentation fault or worse allow an unauthorized user to read from
183183
memory to which they don't have access.

0 commit comments

Comments
 (0)