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
The sentence here describing what happens to user1 after it's used to created user2 is inaccurate:
user1
user2
In this example, we can no longer use user1 after creating user2 because the String in the username field of user1 was moved into user2
String
username
This suggests that the entire user1 struct is now unusable, but it is not:
let user1 = User { email: String::from("[email protected]"), username: String::from("someusername123"), active: true, sign_in_count: 1, }; let user2 = User { email: String::from("[email protected]"), ..user1 }; println!("{} {}", user1.active, user1.email); // user1 is still usable
playground
I think a better description would be:
In this example, we can no longer use user1.username after creating user2 because the String in the username field of user1 was moved into user2
user1.username
The text was updated successfully, but these errors were encountered:
Agree. The original sentence is misleading.
Sorry, something went wrong.
No branches or pull requests
The sentence here describing what happens to
user1
after it's used to createduser2
is inaccurate:This suggests that the entire
user1
struct is now unusable, but it is not:playground
I think a better description would be:
The text was updated successfully, but these errors were encountered: