-
Notifications
You must be signed in to change notification settings - Fork 13.4k
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
Conversation
2b069c3
to
00d72a1
Compare
@@ -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); |
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.
Shouldn't it be more accurate to check if the capacity is equal to 10 instead of >= ?
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.
In general, the allocator may give you more than you asked for.
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.
Hum ok.
Just a small nit. Also, is it normal that you have this much commits? |
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.
travis is failing, but overall looks good to me
Travis says the build was cancelled before it ever started (??) but otherwise the change looks good. |
00d72a1
to
d9df296
Compare
rebased, tests pass @bors r=steveklabnik,quietmisdreavus rollup |
📌 Commit d9df296 has been approved by |
…teveklabnik,quietmisdreavus Improve docs & doc examples for HashSet. None
No description provided.