2 ms·
> (That said, if your real complaint is that the official docs on enums are confusing, I'd certainly agree with that.) I'd love more specifics about which docs
by steveklabnik 12y ago
> (That said, if your real complaint is that the official docs on enums are confusing, I'd certainly agree with that.)
I'd love more specifics about which docs, if you have some time.
- geofft 12y agotrpl/enums.md is super weird, and also in the wrong order (the book documents enums before structs, and way before tuple structs, whereas enums are IMO easiest explained once you've already explained structs). I was going to send you a PR tomorrow or so. :)
- steveklabnik 12y agoFair enough. Tomorrow is basically the deadline before 1.0 though, so send it early :)
- ajross 12y agoI hestiate to speak because everyone will turn it gray, but it's worth pointing out that the whole idea of enums having C-like "discriminants", which like four people have yelled at me about, is entirely missing from the book. I had to go look it up in the reference, where it is sort of hidden too.
- geofft 12y agoI just sent in this PR, is this helpful? https://github.com/rust-lang/rust/pull/25348 https://github.com/rust-lang/rust/pull/25348 Specifically I ended up rewriting most of the enum page: https://github.com/geofft/rust/blob/trpl-fix-enums/src/doc/trpl/enums.md https://github.com/geofft/rust/blob/trpl-fix-enums/src/doc/t... I think there's more that can be done (e.g. the book doesn't document that if every variant of an enum is data-less, you can cast it to an integer), but hopefully this is a start.