Use the term struct-like variant instead of anonymous structs for data of struct-like enum variants#152530
Conversation
|
r? @ChrisDenton rustbot has assigned @ChrisDenton. Use Why was this reviewer chosen?The reviewer was selected based on:
|
|
To me "struct-like data" still seems a bit jargony without it being defined.
I think that would be my preference if you're able to rephrase it. At least the reference (which is linked) contains that exact phrase so it should be clear what's meant. |
|
@rustbot author |
|
Reminder, once the PR becomes ready for a review, use |
84e5839 to
0b7c4dc
Compare
This comment has been minimized.
This comment has been minimized.
…uct-like enum variants This closer follows the terminology used in the Rust Book and Reference. [Rust Book](https://doc.rust-lang.org/stable/book/ch06-01-defining-an-enum.html#listing-6-2): > named fields, like a struct [Reference](https://doc.rust-lang.org/stable/reference/items/enumerations.html#r-items.enum.constructor): > struct-like enum variant
0b7c4dc to
0330663
Compare
|
This PR was rebased onto a different main commit. Here's a range-diff highlighting what actually changed. Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers. |
|
Thanks! @bors r+ rollup |
Rollup merge of #152530 - orzechow:struct_like_enum_variants_docs, r=ChrisDenton Use the term struct-like variant instead of anonymous structs for data of struct-like enum variants The current term in the docs `anonymous structs` seems to be outdated. I'd suggest `struct-like data` or rephrasing the whole sentence to use `struct-like variant`. The terminology used in the [Rust Book on enums](https://doc.rust-lang.org/stable/book/ch06-01-defining-an-enum.html#listing-6-2) is > named fields, like a struct The [Reference on enums](https://doc.rust-lang.org/stable/reference/items/enumerations.html#r-items.enum.constructor) uses > struct-like enum variant The term `anonymous struct` on the other hand is neither mentioned in the Rust book on [structs](https://doc.rust-lang.org/stable/book/ch05-01-defining-structs.html) or [enums](https://doc.rust-lang.org/stable/book/ch06-01-defining-an-enum.html#listing-6-2), nor the references on [structs](https://doc.rust-lang.org/stable/reference/items/structs.html) or [enums](https://doc.rust-lang.org/stable/reference/items/enumerations.html#r-items.enum.constructor).
The current term in the docs
anonymous structsseems to be outdated.I'd suggest
struct-like dataor rephrasing the whole sentence to usestruct-like variant.The terminology used in the Rust Book on enums is
The Reference on enums uses
The term
anonymous structon the other hand is neither mentioned in the Rust book on structs or enums, nor the references on structs or enums.