@@ -184,7 +184,7 @@ impl<K, V> NodeRef<marker::Owned, K, V, marker::LeafOrInternal> {
184184
185185 /// Removes the internal root node, using its first child as the new root node.
186186 /// As it is intended only to be called when the root node has only one child,
187- /// no cleanup is done on any of the other children.
187+ /// no cleanup is done on any of the keys, values and other children.
188188 /// This decreases the height by 1 and is the opposite of `push_internal_level`.
189189 ///
190190 /// Requires exclusive access to the `Root` object but not to the root node;
@@ -225,7 +225,7 @@ impl<K, V> NodeRef<marker::Owned, K, V, marker::LeafOrInternal> {
225225/// - When this is `Owned`, the `NodeRef` acts roughly like `Box<Node>`,
226226/// but does not have a destructor, and must be cleaned up manually.
227227/// Since any `NodeRef` allows navigating through the tree, `BorrowType`
228- /// effectively applies to the entire tree, not just the node itself.
228+ /// effectively applies to the entire tree, not just to the node itself.
229229/// - `K` and `V`: These are the types of keys and values stored in the nodes.
230230/// - `Type`: This can be `Leaf`, `Internal`, or `LeafOrInternal`. When this is
231231/// `Leaf`, the `NodeRef` points to a leaf node, when this is `Internal` the
@@ -425,7 +425,7 @@ impl<'a, K: 'a, V: 'a, Type> NodeRef<marker::Immut<'a>, K, V, Type> {
425425
426426impl < K , V > NodeRef < marker:: Owned , K , V , marker:: LeafOrInternal > {
427427 /// Similar to `ascend`, gets a reference to a node's parent node, but also
428- /// deallocate the current node in the process. This is unsafe because the
428+ /// deallocates the current node in the process. This is unsafe because the
429429 /// current node will still be accessible despite being deallocated.
430430 pub unsafe fn deallocate_and_ascend (
431431 self ,
@@ -661,7 +661,10 @@ impl<'a, K: 'a, V: 'a> NodeRef<marker::Mut<'a>, K, V, marker::LeafOrInternal> {
661661 /// Removes a key-value pair from the end of the node and returns the pair.
662662 /// Also removes the edge that was to the right of that pair and, if the node
663663 /// is internal, returns the orphaned subtree that this edge owned.
664- fn pop ( & mut self ) -> ( K , V , Option < Root < K , V > > ) {
664+ ///
665+ /// # Safety
666+ /// The node must not be empty.
667+ unsafe fn pop ( & mut self ) -> ( K , V , Option < Root < K , V > > ) {
665668 debug_assert ! ( self . len( ) > 0 ) ;
666669
667670 let idx = self . len ( ) - 1 ;
0 commit comments