-
Notifications
You must be signed in to change notification settings - Fork 10.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: Add enums exercises #224
Conversation
9ca2030
to
a60d34e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fundamentally it's a good idea, but I don't think having IP address kind as a reference enum is a good idea, since not all people might be familiar with it. Why not go for the Coin
example for all exercises?
Also, I noticed there's two enums PRs now, so I'll cc @xmaayy on this just to be sure. If the feedback here gets addressed and there's nothing else, I'll merge this one since the other one doesn't seem to be active.
☔ The latest upstream changes (presumably #219) made this pull request unmergeable. Please resolve the merge conflicts. |
I’ll go ahead and update the exercises. Though the book itself uses ipaddr and ipkind as a point of interest (this is mainly what I followed here). Note the use of IpAddr/IpKind here https://doc.rust-lang.org/book/ch06-01-defining-an-enum.html |
@fmoko I ended up just simplifying the implementations to just stick with the |
Does @bors need to rerun to remove the label |
Merging this now. @bors: r+ |
📌 Commit dc15032 has been approved by |
feat: Add enums exercises Creates an exhaustive list of enum exercises. This goes through the basics of different ways to derive enums with mixed data type variants, as well as the use of the all important `match` operator.
☀️ Test successful - checks-travis |
feat: Add enums exercises Creates an exhaustive list of enum exercises. This goes through the basics of different ways to derive enums with mixed data type variants, as well as the use of the all important `match` operator.
feat: Add enums exercises Creates an exhaustive list of enum exercises. This goes through the basics of different ways to derive enums with mixed data type variants, as well as the use of the all important `match` operator.
Creates an exhaustive list of enum exercises. This goes through the basics of different ways to derive enums with mixed data type variants, as well as the use of the all important
match
operator.