Skip to content

Commit

Permalink
add upvar term to closures.md slides
Browse files Browse the repository at this point in the history
  • Loading branch information
miguelraz committed Mar 4, 2024
1 parent 783bad3 commit 803a2ba
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions training-slides/src/closures.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,9 @@ fn main() {
}
```

The variable `increase_by` that is captured by the closure here is called an `upvar`
or a [free variable](https://rustc-dev-guide.rust-lang.org/closure.html#:~:text=An%20upvar%20is%20a%20variable,the%20context%20of%20the%20closure).

## Capturing Mutably

* Closures can capture their environment by mutable reference
Expand Down

0 comments on commit 803a2ba

Please sign in to comment.