Skip to content

Commit 1599fad

Browse files
committed
Show the capacity in HashSet::with_capacity doc example.
1 parent 9e2b0c6 commit 1599fad

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

+1
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,7 @@ impl<T: Hash + Eq> HashSet<T, RandomState> {
147147
/// ```
148148
/// use std::collections::HashSet;
149149
/// let set: HashSet<i32> = HashSet::with_capacity(10);
150+
/// assert!(set.capacity() >= 10);
150151
/// ```
151152
#[inline]
152153
#[stable(feature = "rust1", since = "1.0.0")]

0 commit comments

Comments
 (0)