You've already forked comprehensive-rust
mirror of
https://github.com/google/comprehensive-rust.git
synced 2025-08-10 01:07:09 +02:00
Update destructuring-structs.md (#2807)
In the #2749 , the match arm order has changed. Therefore, the word "second" should be changed to "first" in the notes.
This commit is contained in:
@ -24,7 +24,7 @@ Like tuples, Struct can also be destructured by matching:
|
|||||||
- The same effect occurs with `match &mut foo`: the captures become exclusive
|
- The same effect occurs with `match &mut foo`: the captures become exclusive
|
||||||
references.
|
references.
|
||||||
- The distinction between a capture and a constant expression can be hard to
|
- The distinction between a capture and a constant expression can be hard to
|
||||||
spot. Try changing the `2` in the second arm to a variable, and see that it
|
spot. Try changing the `2` in the first arm to a variable, and see that it
|
||||||
subtly doesn't work. Change it to a `const` and see it working again.
|
subtly doesn't work. Change it to a `const` and see it working again.
|
||||||
|
|
||||||
</details>
|
</details>
|
||||||
|
Reference in New Issue
Block a user