1
0
mirror of https://github.com/google/comprehensive-rust.git synced 2025-06-15 13:50:27 +02:00

Minor fixes (#579)

* order the Cat and Dog correctly in the vec

* make example editable

* patterns: capture vs. constant

* clarify notes on indexing a string
This commit is contained in:
Dustin J. Mitchell
2023-04-24 14:46:38 -04:00
committed by GitHub
parent 4266078684
commit 6744822454
3 changed files with 10 additions and 4 deletions

View File

@ -9,4 +9,8 @@ You can also destructure `structs`:
* Change the literal values in `foo` to match with the other patterns.
* Add a new field to `Foo` and make changes to the pattern as needed.
* 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 subtly
doesn't work. Change it to a `const` and see it working again.
</details>