about summary refs log tree commit diff
path: root/src/libstd
diff options
context:
space:
mode:
authorCorey Farwell <coreyf@rwell.org>2017-08-01 07:42:59 -0400
committerCorey Farwell <coreyf@rwell.org>2017-08-01 19:51:00 -0400
commit9e192602860c897974e81c0c93b9c7293ce0fd3e (patch)
tree12df4cdc7b3b1e6c55b3c9ed9beaea0156edcf57 /src/libstd
parent881062776afe4575f3c9d6534f688a70cf34a7db (diff)
downloadrust-9e192602860c897974e81c0c93b9c7293ce0fd3e.tar.gz
rust-9e192602860c897974e81c0c93b9c7293ce0fd3e.zip
Show that the capacity changed in HashSet::reserve doc example.
Diffstat (limited to 'src/libstd')
-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 040595bbb04..0e65a30f3b2 100644
--- a/src/libstd/collections/hash/set.rs
+++ b/src/libstd/collections/hash/set.rs
@@ -260,6 +260,7 @@ impl<T, S> HashSet<T, S>
     /// use std::collections::HashSet;
     /// let mut set: HashSet<i32> = HashSet::new();
     /// set.reserve(10);
+    /// assert!(set.capacity() >= 10);
     /// ```
     #[stable(feature = "rust1", since = "1.0.0")]
     pub fn reserve(&mut self, additional: usize) {