Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ch05 01 Creating Instances From Other Instances With Struct Update Syntax #3297

Closed
2 tasks done
whym1here opened this issue Aug 8, 2022 · 1 comment
Closed
2 tasks done
Milestone

Comments

@whym1here
Copy link

whym1here commented Aug 8, 2022

  • I have checked the latest main branch to see if this has already been fixed
  • I have searched existing issues and pull requests for duplicates

URL to the section(s) of the book with this problem: https://doc.rust-lang.org/book/ch05-01-defining-structs.html#creating-instances-from-other-instances-with-struct-update-syntax

Description of the problem:
The book suggest if we create a struct using .. operator with another struct then the previous struct cannot be used if it has data type that are moved by = assignment operator.

Suggested fix:
I am not really sure about the change as I am new to rust

@whym1here whym1here changed the title the struct update syntax uses = like an assignment; this is because it moves the data ch05 01 Creating Instances From Other Instances With Struct Update Syntax Aug 8, 2022
@carols10cents carols10cents added this to the ch5 milestone Aug 9, 2022
MohamedAbdeen21 added a commit to MohamedAbdeen21/book that referenced this issue Aug 23, 2022
@carols10cents
Copy link
Member

Closing as duplicate of #2978

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

No branches or pull requests

2 participants