-
Notifications
You must be signed in to change notification settings - Fork 13.3k
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
Conversation
Awesome. Thank you for docs. 😍 |
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.
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`. |
There was a problem hiding this comment.
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.
Is this ready to go? |
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. |
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.
Ah I see, will do in the future. Thanks. |
Store binding mode for each instance of a binding independently fix rust-lang#15787
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 aduplicate trait in the docs.