Skip to content
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

Add an example about returning values with break #867

Merged
merged 1 commit into from
Jul 24, 2017
Merged

Add an example about returning values with break #867

merged 1 commit into from
Jul 24, 2017

Conversation

pietroalbini
Copy link
Member

This pull request adds an example for the loop_break_value feature (which should be stabilized after all the documentation is ready), tracked in issue rust-lang/rust#37339.

The example doesn't do much, but without introducing random things, threads or the network in it there aren't many things to retry.

};

// This should print "The result is 20"
println!("The result is {}", result)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not putting an assert then?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep, that's better.

This commit adds an example for the loop_break_value feature.
@GuillaumeGomez
Copy link
Member

👍

@steveklabnik
Copy link
Member

Thank you! This looks great. Now we wait for it to hit stable.

@pietroalbini
Copy link
Member Author

The stabilization PR was merged \o/ Should we merge this now?

@steveklabnik
Copy link
Member

We have to actually wait for it to land in stable rust; RBE doesn't have a train structure.

@steveklabnik steveklabnik merged commit 201ad85 into rust-lang:master Jul 24, 2017
@steveklabnik
Copy link
Member

At long last, this has landed. Thanks so much @pietroalbini !

@pietroalbini pietroalbini deleted the loop_break_value branch July 31, 2017 15:36
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants