๐Ÿ“  Rust Closures

= anonymous functions in ๐Ÿฆ€ Rust

Usage

  • |parameter| -> return_type {...}
    • e.g.: |text| println("{}", text) -> prints the variable text

Threads

To use variables in threads with closures, you need to

  • move the value
  • move a copy of the value