Skip to content

Commit 9e19260

Browse files
committed
Show that the capacity changed in HashSet::reserve doc example.
1 parent 8810627 commit 9e19260

File tree

1 file changed

+1
-0
lines changed
  • src/libstd/collections/hash

1 file changed

+1
-0
lines changed

src/libstd/collections/hash/set.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -260,6 +260,7 @@ impl<T, S> HashSet<T, S>
260260
/// use std::collections::HashSet;
261261
/// let mut set: HashSet<i32> = HashSet::new();
262262
/// set.reserve(10);
263+
/// assert!(set.capacity() >= 10);
263264
/// ```
264265
#[stable(feature = "rust1", since = "1.0.0")]
265266
pub fn reserve(&mut self, additional: usize) {

0 commit comments

Comments
 (0)