Show the capacity in HashSet::with_capacity doc example.

This commit is contained in:
Corey Farwell 2017-08-01 07:47:17 -04:00
parent 9e2b0c6390
commit 1599fad5b4

View File

@ -147,6 +147,7 @@ impl<T: Hash + Eq> HashSet<T, RandomState> {
/// ```
/// use std::collections::HashSet;
/// let set: HashSet<i32> = HashSet::with_capacity(10);
/// assert!(set.capacity() >= 10);
/// ```
#[inline]
#[stable(feature = "rust1", since = "1.0.0")]