From e0da5482f8d1cb6f1ac24be5991ae1ff09c108bc Mon Sep 17 00:00:00 2001 From: hasezoey Date: Wed, 19 Nov 2025 13:10:09 +0100 Subject: [PATCH 1/3] deps(orx-selfref-col): update to 2.15.0 --- Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index 87fd051..7b26598 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -17,7 +17,7 @@ orx-self-or = "1.2.0" serde = { version = "1.0.228", optional = true, default-features = false } orx-pinned-vec = { version = "3.21.0", default-features = false } orx-split-vec = { version = "3.22.0", default-features = false } -orx-selfref-col = { version = "2.14.0", default-features = false } +orx-selfref-col = { version = "2.15.0", default-features = false } orx-concurrent-iter = { version = "3.1.0", default-features = false } orx-parallel = { version = "3.3.0", default-features = false, optional = true } From 346149ba92e1b543b3cd680f32d9bd2514f022bc Mon Sep 17 00:00:00 2001 From: hasezoey Date: Tue, 18 Nov 2025 18:09:55 +0100 Subject: [PATCH 2/3] feat(tree_node_idx::NodeIdx): implement "Copy" --- src/tree_node_idx.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/tree_node_idx.rs b/src/tree_node_idx.rs index 132addd..6c68737 100644 --- a/src/tree_node_idx.rs +++ b/src/tree_node_idx.rs @@ -284,9 +284,12 @@ impl NodeIdx { } } +// Only the pointer is copied, so "V" does not need to be copy itself. +impl Copy for NodeIdx {} + impl Clone for NodeIdx { fn clone(&self) -> Self { - Self(self.0.clone()) + *self } } From 6be304701d86e1e1b26d3e3522585217133bc356 Mon Sep 17 00:00:00 2001 From: hasezoey Date: Tue, 18 Nov 2025 18:10:53 +0100 Subject: [PATCH 3/3] style: remove "idx.clone" due to NodeIdx being Copy now --- src/subtrees_within/cloned_subtree.rs | 2 +- src/subtrees_within/copied_subtree.rs | 2 +- src/subtrees_within/moved_subtree.rs | 2 +- src/tree_node_idx.rs | 6 +++--- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/subtrees_within/cloned_subtree.rs b/src/subtrees_within/cloned_subtree.rs index 0335544..7129b65 100644 --- a/src/subtrees_within/cloned_subtree.rs +++ b/src/subtrees_within/cloned_subtree.rs @@ -48,6 +48,6 @@ where }); parent.append_subtree_as_child(subtree, child_position); - self.idx.clone() + self.idx } } diff --git a/src/subtrees_within/copied_subtree.rs b/src/subtrees_within/copied_subtree.rs index 0add042..e8d2d16 100644 --- a/src/subtrees_within/copied_subtree.rs +++ b/src/subtrees_within/copied_subtree.rs @@ -45,6 +45,6 @@ where }); parent.append_subtree_as_child(subtree, child_position); - self.idx.clone() + self.idx } } diff --git a/src/subtrees_within/moved_subtree.rs b/src/subtrees_within/moved_subtree.rs index ad59abb..b9e9f69 100644 --- a/src/subtrees_within/moved_subtree.rs +++ b/src/subtrees_within/moved_subtree.rs @@ -49,6 +49,6 @@ impl SubTreeWithinCore for MovedSubTreeWithin { let node_parent = unsafe { &mut *ptr_parent.ptr_mut() }; node_parent.next_mut().insert(child_position, ptr_child); - self.idx.clone() + self.idx } } diff --git a/src/tree_node_idx.rs b/src/tree_node_idx.rs index 6c68737..7849530 100644 --- a/src/tree_node_idx.rs +++ b/src/tree_node_idx.rs @@ -248,7 +248,7 @@ impl NodeIdx { /// [`push_child_tree_within`]: crate::NodeMut::push_child_tree_within /// [`push_sibling_tree_within`]: crate::NodeMut::push_sibling_tree_within pub fn into_subtree_within(&self) -> MovedSubTreeWithin { - MovedSubTreeWithin::new(self.clone()) + MovedSubTreeWithin::new(*self) } /// Creates a subtree view including this node as the root and all of its descendants with their orientation relative @@ -264,7 +264,7 @@ impl NodeIdx { where V::Item: Clone, { - ClonedSubTreeWithin::new(self.clone()) + ClonedSubTreeWithin::new(*self) } /// Creates a subtree view including this node as the root and all of its descendants with their orientation relative @@ -280,7 +280,7 @@ impl NodeIdx { where V::Item: Copy, { - CopiedSubTreeWithin::new(self.clone()) + CopiedSubTreeWithin::new(*self) } }