Skip to content

Improve docs & doc examples for HashSet. #43585

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 7 commits into from
Aug 2, 2017

Conversation

frewsxcv
Copy link
Member

@frewsxcv frewsxcv commented Aug 1, 2017

No description provided.

@@ -146,7 +146,8 @@ impl<T: Hash + Eq> HashSet<T, RandomState> {
///
/// ```
/// use std::collections::HashSet;
/// let mut set: HashSet<i32> = HashSet::with_capacity(10);
/// let set: HashSet<i32> = HashSet::with_capacity(10);
/// assert!(set.capacity() >= 10);
Copy link
Member

Choose a reason for hiding this comment

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

Shouldn't it be more accurate to check if the capacity is equal to 10 instead of >= ?

Copy link
Member

Choose a reason for hiding this comment

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

In general, the allocator may give you more than you asked for.

Copy link
Member

Choose a reason for hiding this comment

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

Hum ok.

@GuillaumeGomez
Copy link
Member

Just a small nit. Also, is it normal that you have this much commits?

Copy link
Member

@steveklabnik steveklabnik left a comment

Choose a reason for hiding this comment

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

travis is failing, but overall looks good to me

@QuietMisdreavus
Copy link
Member

Travis says the build was cancelled before it ever started (??) but otherwise the change looks good.

@frewsxcv frewsxcv closed this Aug 1, 2017
@frewsxcv frewsxcv reopened this Aug 1, 2017
@frewsxcv frewsxcv force-pushed the frewsxcv-hashset-docs branch from 00d72a1 to d9df296 Compare August 1, 2017 23:51
@frewsxcv
Copy link
Member Author

frewsxcv commented Aug 2, 2017

rebased, tests pass

@bors r=steveklabnik,quietmisdreavus rollup

@bors
Copy link
Collaborator

bors commented Aug 2, 2017

📌 Commit d9df296 has been approved by steveklabnik,quietmisdreavus

frewsxcv added a commit to frewsxcv/rust that referenced this pull request Aug 2, 2017
…teveklabnik,quietmisdreavus

Improve docs & doc examples for HashSet.

None
bors added a commit that referenced this pull request Aug 2, 2017
Rollup of 6 pull requests

- Successful merges: #43389, #43423, #43581, #43585, #43597, #43598
- Failed merges:
@bors bors merged commit d9df296 into rust-lang:master Aug 2, 2017
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