-
Notifications
You must be signed in to change notification settings - Fork 13.1k
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
Give more detail about eq in book about enums #21860
Conversation
r? @pcwalton (rust_highfive has picked a reviewer for you, use r? to override) |
} | ||
``` | ||
|
||
An `enum` variant, can be defined as most normal types. Below are some example |
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.
you don't need the comma here
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.
fixed
Thanks for this @mdinger ! I think that conceptually, I like this patch. We need to do some wordsmithing, but I like the general approach. |
Oh good. Thanks for the quick look over. Long lead times get frustrating. Actually, I think I may be able to work in |
Yeah, I'm at an airport right now, about to fly from Europe to Australia, so apologies if there ends up being a longer time for reviewing. For the benefit of other committers, since this is mostly grammar nitpicking, I'm comfortable r+ing this, since I'm going to end up doing a full editing pass later, and it is just nitpicks.
I don't think that's a good idea: we haven't covered any of the relevant information yet. |
953b00a
to
a9583d6
Compare
Okay. I'll do make check and check the links in the morning. I do tend to agree but this still leaves it open to the reader deciding "I want to define By the way, you guys typically have amazing response times. Especially when it's just a few minutes and since you deal with 100's of emails a day. |
Thanks. 😄 |
|
⌛ Testing commit a9583d6 with merge 581b4f1... |
💔 Test failed - auto-mac-64-nopt-t |
@bors: retry |
Second try to address #21196 . A lot that was removed at the end basically seemed repetitive showing simple variations on the same type. It seems more effective to just show more variants at the beginning instead. If you want to pack values into an example, better to use `i32` or some digit than `String` because you don't need the `to_string()` method. I didn't mention `derive` because: * I can't explain it (only use it) * I don't have a link to a good description (maybe rustbyexample but you probably want links internal) * Giving more detail especially stating that `==` won't work and why should help quite a bit I didn't `make test` or check links but I will if this will be merged. @steveklabnik
Second try to address #21196 . A lot that was removed at the end basically seemed repetitive showing simple variations on the same type. It seems more effective to just show more variants at the beginning instead.
If you want to pack values into an example, better to use
i32
or some digit thanString
because you don't need theto_string()
method.I didn't mention
derive
because:==
won't work and why should help quite a bitI didn't
make test
or check links but I will if this will be merged.@steveklabnik