diff options
Diffstat (limited to 'library/alloc/src/vec')
| -rw-r--r-- | library/alloc/src/vec/mod.rs | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/library/alloc/src/vec/mod.rs b/library/alloc/src/vec/mod.rs index 06a7c335bf0..61e018285ce 100644 --- a/library/alloc/src/vec/mod.rs +++ b/library/alloc/src/vec/mod.rs @@ -1360,6 +1360,12 @@ impl<T, A: Allocator> Vec<T, A> { /// Removes and returns the element at position `index` within the vector, /// 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 + /// to be preserved, use [`swap_remove`] instead. + /// + /// [`swap_remove`]: Vec::swap_remove + /// /// # Panics /// /// Panics if `index` is out of bounds. |
