From 1599fad5b485cbfbed698df3590665f064999948 Mon Sep 17 00:00:00 2001 From: Corey Farwell Date: Tue, 1 Aug 2017 07:47:17 -0400 Subject: Show the capacity in HashSet::with_capacity doc example. --- src/libstd/collections/hash/set.rs | 1 + 1 file changed, 1 insertion(+) (limited to 'src/libstd') 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 HashSet { /// ``` /// use std::collections::HashSet; /// let set: HashSet = HashSet::with_capacity(10); + /// assert!(set.capacity() >= 10); /// ``` #[inline] #[stable(feature = "rust1", since = "1.0.0")] -- cgit 1.4.1-3-g733a5