Skip to content

Commit

Permalink
mention remove in swap_remove
Browse files Browse the repository at this point in the history
  • Loading branch information
wooster0 committed Nov 1, 2021
1 parent e9b0d99 commit 5f6cfd2
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion library/alloc/src/vec/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1272,6 +1272,9 @@ impl<T, A: Allocator> Vec<T, A> {
/// The removed element is replaced by the last element of the vector.
///
/// This does not preserve ordering, but is *O*(1).
/// If you need to preserve the element order, use [`remove`] instead.
///
/// [`remove`]: Vec::remove
///
/// # Panics
///
Expand Down Expand Up @@ -1368,7 +1371,7 @@ impl<T, A: Allocator> Vec<T, A> {
/// shifting all elements after it to the left.
///
/// Note: Because this shifts over the remaining elements, it has a
/// worst-case performance of O(n). If you don't need the order of elements
/// worst-case performance of *O*(*n*). If you don't need the order of elements
/// to be preserved, use [`swap_remove`] instead.
///
/// [`swap_remove`]: Vec::swap_remove
Expand Down

0 comments on commit 5f6cfd2

Please sign in to comment.