mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-22 23:04:33 +00:00
collections: Tweak docs for push
This commit is contained in:
parent
054b1ff989
commit
63d1137d68
@ -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
|
||||
|
@ -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 {
|
||||
|
Loading…
Reference in New Issue
Block a user