diff options
| author | Corey Farwell <coreyf@rwell.org> | 2017-08-01 07:47:17 -0400 |
|---|---|---|
| committer | Corey Farwell <coreyf@rwell.org> | 2017-08-01 19:51:00 -0400 |
| commit | 1599fad5b485cbfbed698df3590665f064999948 (patch) | |
| tree | c219583c6eeae03097a028d8e4584b9f99f33ade /src/libstd/collections | |
| parent | 9e2b0c6390526e46f7bd217e13c281f7895bd1d9 (diff) | |
| download | rust-1599fad5b485cbfbed698df3590665f064999948.tar.gz rust-1599fad5b485cbfbed698df3590665f064999948.zip | |
Show the capacity in HashSet::with_capacity doc example.
Diffstat (limited to 'src/libstd/collections')
| -rw-r--r-- | src/libstd/collections/hash/set.rs | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/libstd/collections/hash/set.rs b/src/libstd/collections/hash/set.rs index f8a31665714..a02674ed109 100644 --- a/src/libstd/collections/hash/set.rs +++ b/src/libstd/collections/hash/set.rs @@ -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")] |
