Skip to content

Commit

Permalink
collections: Tweak docs for push
Browse files Browse the repository at this point in the history
  • Loading branch information
brson committed Jul 23, 2014
1 parent 054b1ff commit 63d1137
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 4 deletions.
4 changes: 0 additions & 4 deletions src/libcollections/lib.rs
Expand Up @@ -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
Expand Down
13 changes: 13 additions & 0 deletions src/libcollections/vec.rs
Expand Up @@ -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 {
Expand Down

0 comments on commit 63d1137

Please sign in to comment.