]> git.lizzy.rs Git - rust.git/commitdiff
Show the capacity in HashSet::with_capacity doc example.
authorCorey Farwell <coreyf@rwell.org>
Tue, 1 Aug 2017 11:47:17 +0000 (07:47 -0400)
committerCorey Farwell <coreyf@rwell.org>
Tue, 1 Aug 2017 23:51:00 +0000 (19:51 -0400)
src/libstd/collections/hash/set.rs

index f8a3166571403ac9d54e68a9650550e0c2e4ef4b..a02674ed109a6df305d8f410aa31071f99d03e24 100644 (file)
@@ -147,6 +147,7 @@ pub fn new() -> 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")]