Skip to content

Commit f7584d6

Browse files
Fixes requested by steveklabnik.
1 parent 2d5f12b commit f7584d6

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/doc/trpl/ownership.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ take(v);
106106
println!("v[0] is: {}", v[0]);
107107
```
108108

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,
110110
we say that we’ve ‘moved’ the thing we refer to. You don’t need any sort of
111111
special annotation here, it’s the default thing that Rust does.
112112

@@ -123,7 +123,7 @@ let v2 = v;
123123

124124
The first line allocates memory for the vector object, `v`, and for the data it
125125
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`,
127127
it creates a copy of that pointer, for `v2`. Which means that there would be two
128128
pointers to the content of the vector on the heap. It would violate Rust’s
129129
safety guarantees by introducing a data race. Therefore, Rust forbids using `v`
@@ -173,7 +173,7 @@ fn foo(v: Vec<i32>) -> Vec<i32> {
173173
}
174174
```
175175

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:
177177

178178
```rust
179179
fn foo(v1: Vec<i32>, v2: Vec<i32>) -> (Vec<i32>, Vec<i32>, i32) {

0 commit comments

Comments
 (0)