From bb6dca0fc89d335e106151ee334fc18916f63067 Mon Sep 17 00:00:00 2001 From: Jacob Asper Date: Fri, 16 Feb 2024 09:58:34 -0500 Subject: time complexity for push_within_capacity --- library/alloc/src/vec/mod.rs | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'library/alloc/src/vec') diff --git a/library/alloc/src/vec/mod.rs b/library/alloc/src/vec/mod.rs index 7bdf92053f1..d6e2bd32400 100644 --- a/library/alloc/src/vec/mod.rs +++ b/library/alloc/src/vec/mod.rs @@ -1966,6 +1966,10 @@ impl Vec { /// } /// assert_eq!(from_iter_fallible(0..100), Ok(Vec::from_iter(0..100))); /// ``` + /// + /// # Time complexity + /// + /// Takes *O*(1) time. #[inline] #[unstable(feature = "vec_push_within_capacity", issue = "100486")] pub fn push_within_capacity(&mut self, value: T) -> Result<(), T> { -- cgit 1.4.1-3-g733a5