mirror of
https://github.com/rust-lang/rust.git
synced 2024-12-02 19:53:46 +00:00
Show that the capacity changed in HashSet::reserve doc example.
This commit is contained in:
parent
881062776a
commit
9e19260286
@ -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…
Reference in New Issue
Block a user