We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
main
URL to the section(s) of the book with this problem: https://doc.rust-lang.org/book/ch05-01-defining-structs.html
Description of the problem: Listing 5-6 code reads:
fn main() { // --snip-- let user2 = User { active: user1.active, username: user1.username, email: String::from("another@example.com"), sign_in_count: user1.sign_in_count, }; }
Listing 5-6: Creating a new User instance using one of the values from user1
It seems to me that we we are copying all the fields from user1 into user2 and only changing one of them - email.
Suggested fix:
Maybe the description under the code should say:
Listing 5-6: Creating a new User instance using all but one of the values from user1
The text was updated successfully, but these errors were encountered:
Correct the description of Listing 5-6
3e96c36
It used to have the inverse of what it was actually doing! Fixes #3488
Thanks for filing this – you’re absolutely right! I just opened #3878 to fix this. Much obliged!
Sorry, something went wrong.
Successfully merging a pull request may close this issue.
main
branch to see if this has already been fixed, in this file:URL to the section(s) of the book with this problem:
https://doc.rust-lang.org/book/ch05-01-defining-structs.html
Description of the problem:
Listing 5-6 code reads:
It seems to me that we we are copying all the fields from user1 into user2 and only changing one of them - email.
Suggested fix:
Maybe the description under the code should say:
The text was updated successfully, but these errors were encountered: