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
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 1 addition & 4 deletions src/libstd/collections/hash/set.rs
Original file line number Diff line number Diff line change
Expand Up @@ -544,10 +544,7 @@ impl<T, S> HashSet<T, S>
///
/// If the set did not have a value present, `true` is returned.
///
/// If the set did have this key present, that value is returned, and the
/// 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.

///
/// # Examples
///
Expand Down