-
Notifications
You must be signed in to change notification settings - Fork 13.4k
Match the loop examples #62957
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Match the loop examples #62957
Conversation
r? @aidanhs (rust_highfive has picked a reviewer for you, use r? to override) |
The job Click to expand the log.
I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact |
Can you please elaborate on this change and why it should be done? |
Certainly, when I read the last example it was confusing me that the algorithm demonstrated was not the same. |
38ca20f
to
ccc3b66
Compare
A more explicit variant would be this: let mut i = 1;
let mut something = 0;
loop {
println!("i is {}", i);
if i > 100 {
something = i;
break;
}
i *= 2;
}
assert_eq!(something, 128); |
Hey! This is a ping from triage, we would like to know if you @aidanhs could give us a few minutes to share your thoughts on it. |
ccc3b66
to
ae1e7ca
Compare
I rebased the branch on the current master. Cheers, |
Ping from triage: Requesting a review from @rust-lang/docs |
Ping from triage. @GuillaumeGomez any updates on this? Thanks. |
Thanks! @bors: r+ rollup |
📌 Commit ae1e7ca has been approved by |
…umeGomez Match the loop examples The idea is to show the usefulness of the expression side by side.
Rollup of 7 pull requests Successful merges: - #62957 (Match the loop examples) - #63600 (Merge oli-obk mail addresses) - #63684 (Constify LinkedList new function) - #63847 ([rustdoc] Fix system theme detection) - #63999 (Add missing links on AsRef trait) - #64014 ( miri: detect too large dynamically sized objects ) - #64015 (some const-eval test tweaks) Failed merges: r? @ghost
The idea is to show the usefulness of the expression side by side.