diff options
| author | Jacob Asper <jacobasper191@gmail.com> | 2024-02-16 09:59:37 -0500 |
|---|---|---|
| committer | Jacob Asper <jacobasper191@gmail.com> | 2024-02-18 05:21:33 -0500 |
| commit | 0a5d6841e8b14b2a4430ed675d2621fdd6747d04 (patch) | |
| tree | 6a50c4aeb2e544fa17f56e523b9ca956ae5d5d8d /library/alloc/src/vec | |
| parent | bb6dca0fc89d335e106151ee334fc18916f63067 (diff) | |
| download | rust-0a5d6841e8b14b2a4430ed675d2621fdd6747d04.tar.gz rust-0a5d6841e8b14b2a4430ed675d2621fdd6747d04.zip | |
time complexity for pop
Diffstat (limited to 'library/alloc/src/vec')
| -rw-r--r-- | library/alloc/src/vec/mod.rs | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/library/alloc/src/vec/mod.rs b/library/alloc/src/vec/mod.rs index d6e2bd32400..27efffb72ac 100644 --- a/library/alloc/src/vec/mod.rs +++ b/library/alloc/src/vec/mod.rs @@ -1999,6 +1999,10 @@ impl<T, A: Allocator> Vec<T, A> { /// assert_eq!(vec.pop(), Some(3)); /// assert_eq!(vec, [1, 2]); /// ``` + /// + /// # Time complexity + /// + /// Takes *O*(1) time. #[inline] #[stable(feature = "rust1", since = "1.0.0")] pub fn pop(&mut self) -> Option<T> { |
