๐ Rust Closures
= anonymous functions in ๐ฆ Rust
Usage
|parameter| -> return_type {...}
- e.g.:
|text| println("{}", text)
-> prints the variable text
- e.g.:
Threads
To use variables in threads with closures, you need to
move
the valuemove
a copy of the value