Skip to content

Fill in example code for HashMap. #15787

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

Fill in example code for HashMap. #15787

wants to merge 3 commits into from

Conversation

treeman
Copy link
Contributor

@treeman treeman commented Jul 18, 2014

Add an example showing how to use the map with a custom type. Fill in
examples for methods without ones.

Also move pop_equiv next to related public methods, to not create a
duplicate trait in the docs.

@brson
Copy link
Contributor

brson commented Jul 18, 2014

Awesome. Thank you for docs. 😍

treeman added 2 commits July 24, 2014 10:32
Add an example showing how to use the map with a custom type. Fill in
examples for methods in the hashmap file without ones.

Also move pop_equiv next to related public methods, to not create a
duplicate trait implementation in the docs.
@treeman
Copy link
Contributor Author

treeman commented Jul 24, 2014

Rebased.

@@ -729,6 +729,30 @@ impl DefaultResizePolicy {
/// println!("{}: \"{}\"", *book, *review);
/// }
/// ```
///
/// The easiest way to use `HashMap` with a custom type is to derive `Eq` and `Hash`.
/// We must also derive `PartialEq`, but this will in the future be implied by `Eq`.
Copy link
Member

Choose a reason for hiding this comment

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

I think the forward looking " but this will ..." part of the sentence can be removed.

Link to mentioned methods. Use `# Failure` tags to describe failure.
Make `pop_equiv`, `find_equiv` and `get_copy` standalone.
@brson
Copy link
Contributor

brson commented Jul 25, 2014

Is this ready to go?

@alexcrichton
Copy link
Member

Looks good to me, thanks @treeman! Also feel free to comment on the PR whenever you force-push, sadly github doesn't send out notifications otherwise.

bors added a commit that referenced this pull request Jul 25, 2014
Add an example showing how to use the map with a custom type. Fill in
examples for methods  without ones.

Also move `pop_equiv` next to related public methods, to not create a
duplicate trait in the docs.
@bors bors closed this Jul 26, 2014
@treeman
Copy link
Contributor Author

treeman commented Jul 26, 2014

Ah I see, will do in the future. Thanks.

@treeman treeman deleted the hashmap-doc branch September 17, 2014 13:10
bors added a commit to rust-lang-ci/rust that referenced this pull request Nov 13, 2023
Store binding mode for each instance of a binding independently

fix rust-lang#15787
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.

5 participants