Skip to content

Commit 40aba86

Browse files
authored
Rollup merge of rust-lang#56672 - ccouzens:master, r=nikic
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
2 parents f7e5aef + 562f33b commit 40aba86

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/liballoc/collections/linked_list.rs

+5-1
Original file line numberDiff line numberDiff line change
@@ -627,7 +627,9 @@ impl<T> LinkedList<T> {
627627
self.pop_front_node().map(Node::into_element)
628628
}
629629

630-
/// Appends an element to the back of a list
630+
/// Appends an element to the back of a list.
631+
///
632+
/// This operation should compute in O(1) time.
631633
///
632634
/// # Examples
633635
///
@@ -647,6 +649,8 @@ impl<T> LinkedList<T> {
647649
/// Removes the last element from a list and returns it, or `None` if
648650
/// it is empty.
649651
///
652+
/// This operation should compute in O(1) time.
653+
///
650654
/// # Examples
651655
///
652656
/// ```

0 commit comments

Comments
 (0)