diff --git a/src/libcollections/dlist.rs b/src/libcollections/dlist.rs index 24df95e77c48..f4d0763421c7 100644 --- a/src/libcollections/dlist.rs +++ b/src/libcollections/dlist.rs @@ -253,6 +253,7 @@ impl Deque for DList { /// Add an element last in the list /// /// O(1) + #[deprecated = "use the `push` method"] fn push_back(&mut self, elt: T) { self.push_back_node(box Node::new(elt)) } @@ -260,6 +261,7 @@ impl Deque for DList { /// Remove the last element and return it, or None if the list is empty /// /// O(1) + #[deprecated = "use the `pop` method"] fn pop_back(&mut self) -> Option { self.pop_back_node().map(|box Node{value, ..}| value) } diff --git a/src/libcollections/lib.rs b/src/libcollections/lib.rs index 2b1d8b140ae5..1cf660e0938d 100644 --- a/src/libcollections/lib.rs +++ b/src/libcollections/lib.rs @@ -492,6 +492,7 @@ pub trait Deque : MutableSeq { /// d.push_back(2i); /// assert_eq!(d.front(), Some(&1i)); /// ``` + #[deprecated = "use the `push` method"] fn push_back(&mut self, elt: T); /// Remove the last element and return it, or `None` if the sequence is empty. @@ -509,6 +510,7 @@ pub trait Deque : MutableSeq { /// assert_eq!(d.pop_back(), Some(1i)); /// assert_eq!(d.pop_back(), None); /// ``` + #[deprecated = "use the `pop` method"] fn pop_back(&mut self) -> Option; /// Remove the first element and return it, or `None` if the sequence is empty. diff --git a/src/libcollections/ringbuf.rs b/src/libcollections/ringbuf.rs index 05dda9303986..9d24b349c975 100644 --- a/src/libcollections/ringbuf.rs +++ b/src/libcollections/ringbuf.rs @@ -81,6 +81,7 @@ impl Deque for RingBuf { } /// Remove and return the last element in the RingBuf, or None if it is empty + #[deprecated = "use the `pop` method"] fn pop_back(&mut self) -> Option { if self.nelts > 0 { self.nelts -= 1; @@ -104,6 +105,7 @@ impl Deque for RingBuf { } /// Append an element to the RingBuf + #[deprecated = "use the `push` method"] fn push_back(&mut self, t: T) { if self.nelts == self.elts.len() { grow(self.nelts, &mut self.lo, &mut self.elts);