Skip to content

Commit

Permalink
talk about matches on enums with a match arm body (#198)
Browse files Browse the repository at this point in the history
* clarify how pattern bindings hide variables of the same name

Co-authored-by: Jonathan Pallant <[email protected]>
  • Loading branch information
miguelraz and jonathanpallant committed Dec 24, 2024
1 parent 538c351 commit 3e52d2e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion training-slides/src/compound-types.md
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ fn check_shape(shape: Shape) {
## Doing a `match` on an `enum`

- There are two variables called `radius`
- The later one hides the earlier one
- The binding of `radius` in the pattern on line 9 hides the `radius` variable on line 7

```rust [7|9]
enum Shape {
Expand Down

0 comments on commit 3e52d2e

Please sign in to comment.