mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-23 07:14:28 +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 {
|
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
|
||||||
|
@ -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 {
|
||||||
|
Loading…
Reference in New Issue
Block a user