Another week, another dive into Rust. This time, we're delving into structs. Structs bear resemblance to interfaces in TypeScript, enabling the gro...
For further actions, you may consider blocking this person and/or reporting abuse
It's worth noting that this (tracking which fields are moved out) causes a great deal of complications to Rust core team so this functionality is possibly subject to change.
I didn't know that, is much of the Rust language still subject to change?
Quite so! You may look at list of tracking issues, or, for a central example, into Rustonomicon:
Everything you have written is correct
Well that is a relief βΊοΈ
Issue:
// At this point, book1.rating and book1.unix_release_date
// have been moved to book2 and are no longer accessible
not really true, the f32 implemented Copy trait, so they are not moved to book2, just copy, you can still access book1.rating and book1.unix_release_date.