about summary refs log tree commit diff
path: root/src/libcollections
diff options
context:
space:
mode:
authorBrian Anderson <banderson@mozilla.com>2014-07-14 14:51:54 -0700
committerBrian Anderson <banderson@mozilla.com>2014-07-23 13:20:17 -0700
commit63d1137d68d1394e66815675921210ed8487c01e (patch)
tree9aa6f076940dd5476b6815403b1eef165acc2367 /src/libcollections
parent054b1ff989e278ad1ea278c87beda25a8587d367 (diff)
downloadrust-63d1137d68d1394e66815675921210ed8487c01e.tar.gz
rust-63d1137d68d1394e66815675921210ed8487c01e.zip
collections: Tweak docs for push
Diffstat (limited to 'src/libcollections')
-rw-r--r--src/libcollections/lib.rs4
-rw-r--r--src/libcollections/vec.rs13
2 files changed, 13 insertions, 4 deletions
diff --git a/src/libcollections/lib.rs b/src/libcollections/lib.rs
index 8d008f921da..6882ad9a689 100644
--- a/src/libcollections/lib.rs
+++ b/src/libcollections/lib.rs
@@ -328,10 +328,6 @@ pub trait MutableSet<T>: Set<T> + Mutable {
 pub trait MutableSeq<T>: Mutable {
     /// Append an element to the back of a collection.
     ///
-    /// # Failure
-    ///
-    /// Fails if the number of elements in the vector overflows a `uint`.
-    ///
     /// # Example
     ///
     /// ```rust
diff --git a/src/libcollections/vec.rs b/src/libcollections/vec.rs
index 1f2b7617dfb..17b32e5699d 100644
--- a/src/libcollections/vec.rs
+++ b/src/libcollections/vec.rs
@@ -1557,6 +1557,19 @@ impl<T:fmt::Show> fmt::Show for Vec<T> {
 }
 
 impl<T> MutableSeq<T> for Vec<T> {
+    /// Append an element to the back of a collection.
+    ///
+    /// # Failure
+    ///
+    /// Fails if the number of elements in the vector overflows a `uint`.
+    ///
+    /// # Example
+    ///
+    /// ```rust
+    /// let mut vec = vec!(1i, 2);
+    /// vec.push(3);
+    /// assert_eq!(vec, vec!(1, 2, 3));
+    /// ```
     #[inline]
     fn push(&mut self, value: T) {
         if mem::size_of::<T>() == 0 {