[Docs] intro typo
This commit is contained in:
parent
1c82e60ca7
commit
e1389530cf
1 changed files with 4 additions and 4 deletions
|
@ -442,10 +442,10 @@ It gives us this error:
|
||||||
```
|
```
|
||||||
|
|
||||||
It mentions that "numbers moved into closure environment". Because we referred
|
It mentions that "numbers moved into closure environment". Because we referred
|
||||||
to `numbers` inside of our `proc`, and we create ten `proc`s, we would have ten
|
to `numbers` inside of our `proc`, and we create three `proc`s, we would have
|
||||||
references. Rust detects this and gives us the error: we claim that `numbers`
|
three references. Rust detects this and gives us the error: we claim that
|
||||||
has ownership, but our code tries to make ten owners. This may cause a safety
|
`numbers` has ownership, but our code tries to make ten owners. This may cause
|
||||||
problem, so Rust disallows it.
|
a safety problem, so Rust disallows it.
|
||||||
|
|
||||||
What to do here? Rust has two types that helps us: `Arc<T>` and `Mutex<T>`.
|
What to do here? Rust has two types that helps us: `Arc<T>` and `Mutex<T>`.
|
||||||
"Arc" stands for "atomically reference counted." In other words, an Arc will
|
"Arc" stands for "atomically reference counted." In other words, an Arc will
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue