提交 b0f58f6e 编写于 作者: D Daniel Micay

avoid explicit reborrow in heir_swap

上级 195a969b
......@@ -631,7 +631,7 @@ fn heir_swap<K: Ord, V>(node: &mut TreeNode<K, V>,
// *could* be done without recursion, but it won't borrow check
do child.mutate |mut child| {
if child.right.is_some() {
heir_swap(&mut *node, &mut child.right);
heir_swap(node, &mut child.right);
} else {
node.key <-> child.key;
node.value <-> child.value;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册