We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
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
There is a code example in section 0.7.1 of the Guide (http://static.rust-lang.org/doc/master/guide.html#expressions-vs.-statements), which could be improved.
We use this:
let mut x = 0i; let y = x = 5i;
But, in my opinion, it would be better to use this (avoids making x mutable):
let x; let y = x = 5i;
Is there a reason why we prefer the first code snippet instead of the second? I could submit a PR to fix it.
cc @steveklabnik
The text was updated successfully, but these errors were encountered:
I thought it had to be mutable, but rustc does compile things.
rustc
Yes, please submit a PR so you get credit. 😄 the text will need a tiny change as well.
Sorry, something went wrong.
auto merge of #15456 : aochagavia/rust/guide, r=alexcrichton
00a32f2
Fixes #15452
d6f8271
Successfully merging a pull request may close this issue.
There is a code example in section 0.7.1 of the Guide (http://static.rust-lang.org/doc/master/guide.html#expressions-vs.-statements), which could be improved.
We use this:
But, in my opinion, it would be better to use this (avoids making x mutable):
Is there a reason why we prefer the first code snippet instead of the second? I could submit a PR to fix it.
cc @steveklabnik
The text was updated successfully, but these errors were encountered: