Skip to content

Add examples for Rng functions #5825

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

Closed
wants to merge 3 commits into from
Closed

Add examples for Rng functions #5825

wants to merge 3 commits into from

Conversation

danluu
Copy link
Contributor

@danluu danluu commented Apr 10, 2013

This adds an example for most of the methods in Rng.

As a total newcomer to Rust, it took a while to figure out how to do basic things like use library functions, because there aren't many usage examples, and most examples that Google turns up are out of date. Something like this would have saved me a bit of time.

This might be a bit verbose. Some alternative options would be to consolidate all the examples into one section, or to only have code for the specific function call inline.

@steveklabnik
Copy link
Member

You are so awesome, that is all. ❤️

bors added a commit that referenced this pull request Apr 11, 2013
This adds an example for most of the methods in Rng.

As a total newcomer to Rust, it took a while to figure out how to do basic things like use library functions, because there aren't many usage examples, and most examples that Google turns up are out of date. Something like this would have saved me a bit of time.

This might be a bit verbose. Some alternative options would be to consolidate all the examples into one section, or to only have code for the specific function call inline.
@bors bors closed this Apr 11, 2013
flip1995 added a commit to flip1995/rust that referenced this pull request Aug 11, 2020
Add the new lint `same_item_push`

changelog: Add the new lint `same_item_push`

Fixed rust-lang#4078. As I said in rust-lang/rust-clippy#4078 (comment), I referrerd to rust-lang/rust-clippy#4647.
flip1995 pushed a commit to flip1995/rust that referenced this pull request Aug 11, 2020
Rollup of 5 pull requests

Successful merges:

 - rust-lang#5825 (Add the new lint `same_item_push`)
 - rust-lang#5869 (New lint against `Self` as an arbitrary self type)
 - rust-lang#5870 (enable #[allow(clippy::unsafe_derive_deserialize)])
 - rust-lang#5871 (Lint .min(x).max(y) with x < y)
 - rust-lang#5874 (Make the docs clearer for new contributors)

Failed merges:

r? @ghost

changelog: rollup
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants