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
(I hope I am in the right repo and this isn't a duplicate or a dump question :)
Currently (using rust 1.34.1) destructing a tuple is only possible to newly created variables.
1.34.1
let mut foo = 0; let mut bar = 1; (foo, bar) = (2,3);
This code fails with following error.
| | (foo, bar) = (2,3); | ^^^^^^^^^^^^^^^^^^ left-hand of expression not valid
But this is valid.
let mut foo = 0; let mut bar = 1; let test = (2,3); foo = test.0; bar = test.1;
I think it would be intuitive to destruct into already known variables rather than having to create a new one.
The text was updated successfully, but these errors were encountered:
This is rust-lang/rfcs#372.
Sorry, something went wrong.
No branches or pull requests
(I hope I am in the right repo and this isn't a duplicate or a dump question :)
Currently (using rust
1.34.1
) destructing a tuple is only possible to newly created variables.This code fails with following error.
But this is valid.
I think it would be intuitive to destruct into already known variables rather than having to create a new one.
The text was updated successfully, but these errors were encountered: