From 0a5d6841e8b14b2a4430ed675d2621fdd6747d04 Mon Sep 17 00:00:00 2001 From: Jacob Asper Date: Fri, 16 Feb 2024 09:59:37 -0500 Subject: time complexity for pop --- library/alloc/src/vec/mod.rs | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'library/alloc') 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 Vec { /// 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 { -- cgit 1.4.1-3-g733a5