File tree Expand file tree Collapse file tree 2 files changed +23
-23
lines changed Expand file tree Collapse file tree 2 files changed +23
-23
lines changed Original file line number Diff line number Diff line change @@ -326,7 +326,30 @@ pub trait MutableSet<T>: Set<T> + Mutable {
326
326
}
327
327
328
328
pub trait MutableSeq < T > : Mutable {
329
+ /// Append an element to the back of a collection.
330
+ ///
331
+ /// # Failure
332
+ ///
333
+ /// Fails if the number of elements in the vector overflows a `uint`.
334
+ ///
335
+ /// # Example
336
+ ///
337
+ /// ```rust
338
+ /// let mut vec = vec!(1i, 2);
339
+ /// vec.push(3);
340
+ /// assert_eq!(vec, vec!(1, 2, 3));
341
+ /// ```
329
342
fn push ( & mut self , t : T ) ;
343
+ /// Remove the last element from a collection and return it, or `None` if it is
344
+ /// empty.
345
+ ///
346
+ /// # Example
347
+ ///
348
+ /// ```rust
349
+ /// let mut vec = vec!(1i, 2, 3);
350
+ /// assert_eq!(vec.pop(), Some(3));
351
+ /// assert_eq!(vec, vec!(1, 2));
352
+ /// ```
330
353
fn pop ( & mut self ) -> Option < T > ;
331
354
}
332
355
Original file line number Diff line number Diff line change @@ -1555,19 +1555,6 @@ impl<T:fmt::Show> fmt::Show for Vec<T> {
1555
1555
}
1556
1556
1557
1557
impl < T > MutableSeq < T > for Vec < T > {
1558
- /// Append an element to a vector.
1559
- ///
1560
- /// # Failure
1561
- ///
1562
- /// Fails if the number of elements in the vector overflows a `uint`.
1563
- ///
1564
- /// # Example
1565
- ///
1566
- /// ```rust
1567
- /// let mut vec = vec!(1i, 2);
1568
- /// vec.push(3);
1569
- /// assert_eq!(vec, vec!(1, 2, 3));
1570
- /// ```
1571
1558
#[ inline]
1572
1559
fn push ( & mut self , value : T ) {
1573
1560
if mem:: size_of :: < T > ( ) == 0 {
@@ -1594,16 +1581,6 @@ impl<T> MutableSeq<T> for Vec<T> {
1594
1581
}
1595
1582
}
1596
1583
1597
- /// Remove the last element from a vector and return it, or `None` if it is
1598
- /// empty.
1599
- ///
1600
- /// # Example
1601
- ///
1602
- /// ```rust
1603
- /// let mut vec = vec!(1i, 2, 3);
1604
- /// assert_eq!(vec.pop(), Some(3));
1605
- /// assert_eq!(vec, vec!(1, 2));
1606
- /// ```
1607
1584
#[ inline]
1608
1585
fn pop ( & mut self ) -> Option < T > {
1609
1586
if self . len == 0 {
You can’t perform that action at this time.
0 commit comments