Show that the capacity changed in HashSet::reserve doc example.
This commit is contained in:
parent
881062776a
commit
9e19260286
1 changed files with 1 additions and 0 deletions
|
@ -260,6 +260,7 @@ impl<T, S> HashSet<T, S>
|
|||
/// use std::collections::HashSet;
|
||||
/// let mut set: HashSet<i32> = HashSet::new();
|
||||
/// set.reserve(10);
|
||||
/// assert!(set.capacity() >= 10);
|
||||
/// ```
|
||||
#[stable(feature = "rust1", since = "1.0.0")]
|
||||
pub fn reserve(&mut self, additional: usize) {
|
||||
|
|
Loading…
Add table
Reference in a new issue