File tree Expand file tree Collapse file tree 3 files changed +6
-0
lines changed Expand file tree Collapse file tree 3 files changed +6
-0
lines changed Original file line number Diff line number Diff line change @@ -253,13 +253,15 @@ impl<T> Deque<T> for DList<T> {
253
253
/// Add an element last in the list
254
254
///
255
255
/// O(1)
256
+ #[ deprecated = "use the `push` method" ]
256
257
fn push_back ( & mut self , elt : T ) {
257
258
self . push_back_node ( box Node :: new ( elt) )
258
259
}
259
260
260
261
/// Remove the last element and return it, or None if the list is empty
261
262
///
262
263
/// O(1)
264
+ #[ deprecated = "use the `pop` method" ]
263
265
fn pop_back ( & mut self ) -> Option < T > {
264
266
self . pop_back_node ( ) . map ( |box Node { value, ..} | value)
265
267
}
Original file line number Diff line number Diff line change @@ -492,6 +492,7 @@ pub trait Deque<T> : MutableSeq<T> {
492
492
/// d.push_back(2i);
493
493
/// assert_eq!(d.front(), Some(&1i));
494
494
/// ```
495
+ #[ deprecated = "use the `push` method" ]
495
496
fn push_back ( & mut self , elt : T ) ;
496
497
497
498
/// Remove the last element and return it, or `None` if the sequence is empty.
@@ -509,6 +510,7 @@ pub trait Deque<T> : MutableSeq<T> {
509
510
/// assert_eq!(d.pop_back(), Some(1i));
510
511
/// assert_eq!(d.pop_back(), None);
511
512
/// ```
513
+ #[ deprecated = "use the `pop` method" ]
512
514
fn pop_back ( & mut self ) -> Option < T > ;
513
515
514
516
/// Remove the first element and return it, or `None` if the sequence is empty.
Original file line number Diff line number Diff line change @@ -81,6 +81,7 @@ impl<T> Deque<T> for RingBuf<T> {
81
81
}
82
82
83
83
/// Remove and return the last element in the RingBuf, or None if it is empty
84
+ #[ deprecated = "use the `pop` method" ]
84
85
fn pop_back ( & mut self ) -> Option < T > {
85
86
if self . nelts > 0 {
86
87
self . nelts -= 1 ;
@@ -104,6 +105,7 @@ impl<T> Deque<T> for RingBuf<T> {
104
105
}
105
106
106
107
/// Append an element to the RingBuf
108
+ #[ deprecated = "use the `push` method" ]
107
109
fn push_back ( & mut self , t : T ) {
108
110
if self . nelts == self . elts . len ( ) {
109
111
grow ( self . nelts , & mut self . lo , & mut self . elts ) ;
You can’t perform that action at this time.
0 commit comments