about summary refs log tree commit diff
path: root/src/libstd/collections
diff options
context:
space:
mode:
authorCorey Farwell <coreyf@rwell.org>2017-08-01 07:47:17 -0400
committerCorey Farwell <coreyf@rwell.org>2017-08-01 19:51:00 -0400
commit1599fad5b485cbfbed698df3590665f064999948 (patch)
treec219583c6eeae03097a028d8e4584b9f99f33ade /src/libstd/collections
parent9e2b0c6390526e46f7bd217e13c281f7895bd1d9 (diff)
downloadrust-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.rs1
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")]