Skip to content

Commit f833593

Browse files
committed
Add swap_take() alias to swap_remove() and co
1 parent c115c3c commit f833593

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

library/alloc/src/collections/vec_deque/mod.rs

+2
Original file line numberDiff line numberDiff line change
@@ -1492,6 +1492,7 @@ impl<T> VecDeque<T> {
14921492
/// assert_eq!(buf.swap_remove_front(2), Some(3));
14931493
/// assert_eq!(buf, [2, 1]);
14941494
/// ```
1495+
#[doc(alias = "swap_take_front")]
14951496
#[stable(feature = "deque_extras_15", since = "1.5.0")]
14961497
pub fn swap_remove_front(&mut self, index: usize) -> Option<T> {
14971498
let length = self.len();
@@ -1527,6 +1528,7 @@ impl<T> VecDeque<T> {
15271528
/// assert_eq!(buf.swap_remove_back(0), Some(1));
15281529
/// assert_eq!(buf, [3, 2]);
15291530
/// ```
1531+
#[doc(alias = "swap_take_back")]
15301532
#[stable(feature = "deque_extras_15", since = "1.5.0")]
15311533
pub fn swap_remove_back(&mut self, index: usize) -> Option<T> {
15321534
let length = self.len();

library/alloc/src/vec/mod.rs

+1
Original file line numberDiff line numberDiff line change
@@ -1254,6 +1254,7 @@ impl<T, A: Allocator> Vec<T, A> {
12541254
/// assert_eq!(v, ["baz", "qux"]);
12551255
/// ```
12561256
#[inline]
1257+
#[doc(alias = "swap_take")]
12571258
#[stable(feature = "rust1", since = "1.0.0")]
12581259
pub fn swap_remove(&mut self, index: usize) -> T {
12591260
#[cold]

0 commit comments

Comments
 (0)