You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Someone working through this book asked me "should I be choosing to order my fields in the struct in a way that makes the most sense for struct update syntax?", which didn't quite make sense to me until I realized that the code gives the impression that struct update syntax can only fill in the last fields of a struct.
It may be worth picking different fields in the example, or explicitly clarifying this. I'm not sure how to do this with picking different fields without changing the motivation there, though.
Note: It was clear to this person that you don't need to specify fields in order for normal struct init syntax, it was specifically this context where they got confused.
The text was updated successfully, but these errors were encountered:
https://doc.rust-lang.org/book/ch05-01-defining-structs.html#creating-instances-from-other-instances-with-struct-update-syntax
Someone working through this book asked me "should I be choosing to order my fields in the struct in a way that makes the most sense for struct update syntax?", which didn't quite make sense to me until I realized that the code gives the impression that struct update syntax can only fill in the last fields of a struct.
It may be worth picking different fields in the example, or explicitly clarifying this. I'm not sure how to do this with picking different fields without changing the motivation there, though.
Note: It was clear to this person that you don't need to specify fields in order for normal struct init syntax, it was specifically this context where they got confused.
The text was updated successfully, but these errors were encountered: