about summary refs log tree commit diff
path: root/src/liballoc/collections
diff options
context:
space:
mode:
authorChris Couzens <ccouzens@ukcloud.com>2018-12-10 12:43:15 +0000
committerChris Couzens <ccouzens@ukcloud.com>2018-12-10 12:43:15 +0000
commit562f33b1a57acb4ccbc741fb32687aedfc4a8398 (patch)
tree6c18f2fa4bd50ee2e4d62c3969f28f0d9b5ea25c /src/liballoc/collections
parent9567a1cf5993d46c00ee2f2b363f3eabe90b2a0e (diff)
downloadrust-562f33b1a57acb4ccbc741fb32687aedfc4a8398.tar.gz
rust-562f33b1a57acb4ccbc741fb32687aedfc4a8398.zip
Document time of back operations of a Linked List
Popping and pushing from the end of a linked list is constant time. This
documentation is already there for popping and pushing from the front.

@bors: r+ 38fe8d2 rollup
Diffstat (limited to 'src/liballoc/collections')
-rw-r--r--src/liballoc/collections/linked_list.rs6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/liballoc/collections/linked_list.rs b/src/liballoc/collections/linked_list.rs
index 2ef84dbade0..ba46fafaf16 100644
--- a/src/liballoc/collections/linked_list.rs
+++ b/src/liballoc/collections/linked_list.rs
@@ -627,7 +627,9 @@ impl<T> LinkedList<T> {
         self.pop_front_node().map(Node::into_element)
     }
 
-    /// Appends an element to the back of a list
+    /// Appends an element to the back of a list.
+    ///
+    /// This operation should compute in O(1) time.
     ///
     /// # Examples
     ///
@@ -647,6 +649,8 @@ impl<T> LinkedList<T> {
     /// Removes the last element from a list and returns it, or `None` if
     /// it is empty.
     ///
+    /// This operation should compute in O(1) time.
+    ///
     /// # Examples
     ///
     /// ```