Skip to content

Mention struct-like variants in enums2 hint instead of anonymous structs#2353

Open
orzechow wants to merge 1 commit intorust-lang:mainfrom
orzechow:improve_enums2_hint
Open

Mention struct-like variants in enums2 hint instead of anonymous structs#2353
orzechow wants to merge 1 commit intorust-lang:mainfrom
orzechow:improve_enums2_hint

Conversation

@orzechow
Copy link

The current hint of the enums2 exercise uses an outdated term for struct-like enum variants, which is confusing to Rust newbies:

You can create enumerations that have different variants with different types such as anonymous structs, structs, a single string, tuples, no data, etc.

The term anonymous struct seems outdated. It's neither mentioned in the Rust book on structs or enums, nor the references on structs or enums.
A web search rather points to a Rust Forum thread hinting

Don’t assume that there is such a thing as “the anonymous struct feature” at all

The only place I found this term, is in the Rust docs on enums, but not in the docs on structs.
It seems like Rust used this term once, but not anymore. See also #1204 and the 2018 edition Rust book on enums.

Instead the book on enums now calls it named fields, like a struct.
The reference on enums uses the term struct-like enum variant.

Therefore, I'd suggest updating this hint to struct-like enum variants.

@orzechow
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant