Made v2 mutable so that we can actually truncate it.

This commit is contained in:
Sandeep Datta 2016-02-17 20:47:24 +05:30
parent 37a952a672
commit 1536195ce6

View File

@ -139,7 +139,7 @@ Now consider the following code fragment:
```rust
let v = vec![1, 2, 3];
let v2 = v;
let mut v2 = v;
```
The first line allocates memory for the vector object `v` on the stack like
@ -167,7 +167,7 @@ For example if we truncated the vector to just two elements through `v2`:
```rust
# let v = vec![1, 2, 3];
# let v2 = v;
# let mut v2 = v;
v2.truncate(2);
```