mention remove in swap_remove

This commit is contained in:
r00ster91 2021-11-01 18:52:26 +01:00
parent e9b0d99259
commit 5f6cfd211a

View File

@ -1272,6 +1272,9 @@ impl<T, A: Allocator> Vec<T, A> {
/// The removed element is replaced by the last element of the vector. /// The removed element is replaced by the last element of the vector.
/// ///
/// This does not preserve ordering, but is *O*(1). /// This does not preserve ordering, but is *O*(1).
/// If you need to preserve the element order, use [`remove`] instead.
///
/// [`remove`]: Vec::remove
/// ///
/// # Panics /// # Panics
/// ///
@ -1368,7 +1371,7 @@ impl<T, A: Allocator> Vec<T, A> {
/// shifting all elements after it to the left. /// shifting all elements after it to the left.
/// ///
/// Note: Because this shifts over the remaining elements, it has a /// 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. /// to be preserved, use [`swap_remove`] instead.
/// ///
/// [`swap_remove`]: Vec::swap_remove /// [`swap_remove`]: Vec::swap_remove