diff options
| author | Jacob Asper <jacobasper191@gmail.com> | 2024-02-16 09:58:34 -0500 |
|---|---|---|
| committer | Jacob Asper <jacobasper191@gmail.com> | 2024-02-18 05:21:33 -0500 |
| commit | bb6dca0fc89d335e106151ee334fc18916f63067 (patch) | |
| tree | 6ea8fa82375138c035a78a9d99cacd43cd6a3ca0 /library/alloc/src | |
| parent | cb8ce9d9e543ccf16a2f0a04e47a3691af10d5a6 (diff) | |
| download | rust-bb6dca0fc89d335e106151ee334fc18916f63067.tar.gz rust-bb6dca0fc89d335e106151ee334fc18916f63067.zip | |
time complexity for push_within_capacity
Diffstat (limited to 'library/alloc/src')
| -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 7bdf92053f1..d6e2bd32400 100644 --- a/library/alloc/src/vec/mod.rs +++ b/library/alloc/src/vec/mod.rs @@ -1966,6 +1966,10 @@ impl<T, A: Allocator> Vec<T, A> { /// } /// 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> { |
