1
0
mirror of https://github.com/google/comprehensive-rust.git synced 2025-08-09 16:58:19 +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:
Enes Aydın
2025-07-16 19:31:04 +03:00
committed by GitHub
parent 059b44bf35
commit 0a485b5a4c

View File

@ -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>