-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
diverging: fix issues with example code #1631
Conversation
- Fixes code not compiling due to missing semicolon - Fixes warning about the unused variable `a`
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @marioidival (or someone else) soon. Please see the contribution instructions for more information. |
Apparently I filed this PR too quick without actually checking if the example code compiles. It does so without the semicolon. I didn't realize I'll leave this PR open as every other example I've looked at includes a semicolon at the end of all statements, but please let me know if omitting it is accepted in Rust syntax (as I don't know enough to comment on it). |
@marioidival may I ask why this was closed without merging? |
@ericswpark your PR is invalid |
@marioidival I see, thank you for the reply. Can you please explain why it is invalid? The macro one I'm not sure about, but the unused variable does emit a warning during compilation and I believe this PR fixes it. |
@marioidival I got curious and decided to look it up. In #183 there is an explanation for why semicolons are not required for In addition, issue #183 links to PR #191, which seems to be the exact same thing as this PR, except that PR #191 adds two semicolons. I'd appreciate it if you could reconsider, or at the very least let me know why you think this PR is invalid. Thanks! |
@marioidival That's both false and rude. Rustaceans should do better than that. |
@ericswpark Hello, I'm sorry about the delay. I skimmed through your description too quickly and didn't notice the addition of the You know that putting a semicolon in that situation is optional, right? Anyway, I'll be happy to accept the warning fix if you want to resubmit it. |
#1631 (comment) |
@marioidival thank you for reconsidering!
Yes, I noticed right after submission: #1631 (comment) While I do apologize for not checking if the code would compile without one I decided to leave the PR as is because other examples in RBE do include semicolons after |
@ericswpark yes, nice perspective.. I do agree with you! |
Update books ## rust-lang/book 3 commits in a60f4316ec923a5ac2ed6a2eba6960edb832d855..2bd5d42c9956369132228da6409f0e68da56c51a 2022-12-22 21:37:10 UTC to 2022-12-22 21:36:14 UTC - fix macos installation problem (rust-lang/book#3469) - Update -guessing-game-tutorial incorrect output (rust-lang/book#3462) - FIX: IT repo updated (rust-lang/book#3454) ## rust-lang/nomicon 1 commits in dd37e21ccee43918ed18a71581bb2af537ffe4fc..8ca261268068d80c0969260fff15199bad87b587 2022-12-30 16:32:09 UTC to 2022-12-30 16:32:09 UTC - Discourage the use of transmute to construct invalid values (rust-lang/nomicon#388) ## rust-lang/rust-by-example 6 commits in 995df09b65c582eb6290ab7ea5d9485983eb4c37..8888f9428fe9a48f31de6bd2cef9b9bf80791edc 2023-01-01 12:53:50 UTC to 2022-12-21 10:18:31 UTC - types/alias: use io::{Result,Error} instead of Io{Result,Error} (rust-lang/rust-by-example#1660) - Fix sample code mismatching its comments (rust-lang/rust-by-example#1659) - fix: add missing space (rust-lang/rust-by-example#1658) - diverging: fix issues with example code (rust-lang/rust-by-example#1631) - Update enum.md (rust-lang/rust-by-example#1645) - Clean up Chapter 2 (Primitives) (rust-lang/rust-by-example#1651) ## rust-lang/rustc-dev-guide 5 commits in 8b42eb5..b3e2a6e 2023-01-01 05:20:47 UTC to 2022-12-25 12:11:21 UTC - Add help for when you update a submodule by accident (rust-lang/rustc-dev-guide#1537) - Simplify "how to build and run" section (rust-lang/rustc-dev-guide#1528) - Replace `$TARGET` with `host` (rust-lang/rustc-dev-guide#1514) - Add more rebasing help (rust-lang/rustc-dev-guide#1536) - Fix rustc_borrowck crate name typo (rust-lang/rustc-dev-guide#1535)
a