File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -442,10 +442,10 @@ It gives us this error:
442
442
```
443
443
444
444
It mentions that "numbers moved into closure environment". Because we referred
445
- to ` numbers ` inside of our ` proc ` , and we create ten ` proc ` s, we would have ten
446
- references. Rust detects this and gives us the error: we claim that ` numbers `
447
- has ownership, but our code tries to make ten owners. This may cause a safety
448
- problem, so Rust disallows it.
445
+ to ` numbers ` inside of our ` proc ` , and we create three ` proc ` s, we would have
446
+ three references. Rust detects this and gives us the error: we claim that
447
+ ` numbers ` has ownership, but our code tries to make ten owners. This may cause
448
+ a safety problem, so Rust disallows it.
449
449
450
450
What to do here? Rust has two types that helps us: ` Arc<T> ` and ` Mutex<T> ` .
451
451
"Arc" stands for "atomically reference counted." In other words, an Arc will
You can’t perform that action at this time.
0 commit comments