Rename idiom

pull/31/head
Mikhail Trishchenkov 8 years ago committed by Chris Wong
parent 9f85aad151
commit 67685cddf0

@ -21,7 +21,7 @@ language.
* TODO interior mutability - UnsafeCell, Cell, RefCell
* TODO treating Option like a list
* TODO `Default` trait
* [Pass clone to closure](idioms/clone-to-closure.md)
* [Pass variables to closure](idioms/pass-var-to-closure.md)
### Design patterns

@ -1,10 +1,10 @@
# Pass clone to closure
# Pass variable to closure
## Description
By default, closures capture their environment by borrowing. Or you can use `move`-closure
to move environment. However, often you want to give copy of some data to closure, pass it
by reference, or perform some other transformation.
to move whole environment. However, often you want to move just some variables to closure,
give it copy of some data, pass it by reference, or perform some other transformation.
Use variable rebinding in separate scope for that.
Loading…
Cancel
Save