Skip to content

Fix docs for HashSet::insert #29851

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

Merged
merged 1 commit into from
Nov 16, 2015
Merged

Fix docs for HashSet::insert #29851

merged 1 commit into from
Nov 16, 2015

Conversation

shahn
Copy link
Contributor

@shahn shahn commented Nov 16, 2015

insert() returns bool, but it was wrongly stated that if the set had the
key already present, that key would be returned (this was probably
copied from the HashMap docs). Also remove a reference to the
module-level documentation, which doesn't make sense as it doesn't give
any more context.

r? @steveklabnik

insert() returns bool, but it was wrongly stated that if the set had the
key already present, that key would be returned (this was probably
copied from the HashMap docs). Also remove a reference to the
module-level documentation, which doesn't make sense as it doesn't give
any more context.
@rust-highfive
Copy link
Contributor

Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @steveklabnik (or someone else) soon.

If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. The way Github handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes.

Please see the contribution instructions for more information.

@steveklabnik
Copy link
Member

@bors: r+

thanks so much! 💯

@bors
Copy link
Collaborator

bors commented Nov 16, 2015

📌 Commit 2569747 has been approved by steveklabnik

@bors
Copy link
Collaborator

bors commented Nov 16, 2015

⌛ Testing commit 2569747 with merge 94ec5f8...

bors added a commit that referenced this pull request Nov 16, 2015
insert() returns bool, but it was wrongly stated that if the set had the
key already present, that key would be returned (this was probably
copied from the HashMap docs). Also remove a reference to the
module-level documentation, which doesn't make sense as it doesn't give
any more context.

r? @steveklabnik
/// entry is not updated. See the [module-level documentation] for more.
///
/// [module-level documentation]: index.html#insert-and-complex-keys
/// If the set did have this key present, `false` is returned.
Copy link
Contributor

Choose a reason for hiding this comment

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

It removes the guarantee, that the key is not updated, added in #27894.
"If the set did have this key present, the key is not updated and false is returned." would be more correct.
Also, BTreeSet has identical docs, they should probably be updated too.

@bors bors merged commit 2569747 into rust-lang:master Nov 16, 2015
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