collections: Tweak docs for push

This commit is contained in:
Brian Anderson 2014-07-14 14:51:54 -07:00
parent 054b1ff989
commit 63d1137d68
2 changed files with 13 additions and 4 deletions

View File

@ -328,10 +328,6 @@ pub trait MutableSet<T>: Set<T> + Mutable {
pub trait MutableSeq<T>: Mutable { pub trait MutableSeq<T>: Mutable {
/// Append an element to the back of a collection. /// Append an element to the back of a collection.
/// ///
/// # Failure
///
/// Fails if the number of elements in the vector overflows a `uint`.
///
/// # Example /// # Example
/// ///
/// ```rust /// ```rust

View File

@ -1557,6 +1557,19 @@ impl<T:fmt::Show> fmt::Show for Vec<T> {
} }
impl<T> MutableSeq<T> 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] #[inline]
fn push(&mut self, value: T) { fn push(&mut self, value: T) {
if mem::size_of::<T>() == 0 { if mem::size_of::<T>() == 0 {