@@ -179,7 +179,7 @@ impl<K, V> NodeRef<marker::Owned, K, V, marker::LeafOrInternal> {
179179
180180 /// Removes the internal root node, using its first child as the new root node.
181181 /// As it is intended only to be called when the root node has only one child,
182- /// no cleanup is done on any of the other children.
182+ /// no cleanup is done on any of the keys, values and other children.
183183 /// This decreases the height by 1 and is the opposite of `push_internal_level`.
184184 ///
185185 /// Requires exclusive access to the `Root` object but not to the root node;
@@ -220,7 +220,7 @@ impl<K, V> NodeRef<marker::Owned, K, V, marker::LeafOrInternal> {
220220/// - When this is `Owned`, the `NodeRef` acts roughly like `Box<Node>`,
221221/// but does not have a destructor, and must be cleaned up manually.
222222/// Since any `NodeRef` allows navigating through the tree, `BorrowType`
223- /// effectively applies to the entire tree, not just the node itself.
223+ /// effectively applies to the entire tree, not just to the node itself.
224224/// - `K` and `V`: These are the types of keys and values stored in the nodes.
225225/// - `Type`: This can be `Leaf`, `Internal`, or `LeafOrInternal`. When this is
226226/// `Leaf`, the `NodeRef` points to a leaf node, when this is `Internal` the
@@ -420,7 +420,7 @@ impl<'a, K: 'a, V: 'a, Type> NodeRef<marker::Immut<'a>, K, V, Type> {
420420
421421impl < K , V > NodeRef < marker:: Owned , K , V , marker:: LeafOrInternal > {
422422 /// Similar to `ascend`, gets a reference to a node's parent node, but also
423- /// deallocate the current node in the process. This is unsafe because the
423+ /// deallocates the current node in the process. This is unsafe because the
424424 /// current node will still be accessible despite being deallocated.
425425 pub unsafe fn deallocate_and_ascend (
426426 self ,
@@ -656,7 +656,10 @@ impl<'a, K: 'a, V: 'a> NodeRef<marker::Mut<'a>, K, V, marker::LeafOrInternal> {
656656 /// Removes a key-value pair from the end of the node and returns the pair.
657657 /// Also removes the edge that was to the right of that pair and, if the node
658658 /// is internal, returns the orphaned subtree that this edge owned.
659- fn pop ( & mut self ) -> ( K , V , Option < Root < K , V > > ) {
659+ ///
660+ /// # Safety
661+ /// The node must not be empty.
662+ unsafe fn pop ( & mut self ) -> ( K , V , Option < Root < K , V > > ) {
660663 debug_assert ! ( self . len( ) > 0 ) ;
661664
662665 let idx = self . len ( ) - 1 ;
0 commit comments