@@ -106,7 +106,7 @@ take(v);
106
106
println!("v[0] is: {}", v[0]);
107
107
```
108
108
109
- Same error: “ use of moved value” . When we transfer ownership to something else,
109
+ Same error: ‘ use of moved value’ . When we transfer ownership to something else,
110
110
we say that we’ve ‘moved’ the thing we refer to. You don’t need any sort of
111
111
special annotation here, it’s the default thing that Rust does.
112
112
@@ -123,7 +123,7 @@ let v2 = v;
123
123
124
124
The first line allocates memory for the vector object, ` v ` , and for the data it
125
125
contains. The vector object is stored on the [ stack] [ sh ] and contains a pointer
126
- to the content ([ 1, 2, 3] ) stored on the [ heap] [ sh ] . When we move ` v ` to ` v2 ` ,
126
+ to the content (` [1, 2, 3] ` ) stored on the [ heap] [ sh ] . When we move ` v ` to ` v2 ` ,
127
127
it creates a copy of that pointer, for ` v2 ` . Which means that there would be two
128
128
pointers to the content of the vector on the heap. It would violate Rust’s
129
129
safety guarantees by introducing a data race. Therefore, Rust forbids using ` v `
@@ -173,7 +173,7 @@ fn foo(v: Vec<i32>) -> Vec<i32> {
173
173
}
174
174
```
175
175
176
- This would get very tedius. It gets the worse the more things we want to take ownership of:
176
+ This would get very tedius. It gets worse the more things we want to take ownership of:
177
177
178
178
``` rust
179
179
fn foo (v1 : Vec <i32 >, v2 : Vec <i32 >) -> (Vec <i32 >, Vec <i32 >, i32 ) {
0 commit comments