Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }

Expand Down
2 changes: 1 addition & 1 deletion src/subtrees_within/cloned_subtree.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,6 @@ where
});
parent.append_subtree_as_child(subtree, child_position);

self.idx.clone()
self.idx
}
}
2 changes: 1 addition & 1 deletion src/subtrees_within/copied_subtree.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,6 @@ where
});
parent.append_subtree_as_child(subtree, child_position);

self.idx.clone()
self.idx
}
}
2 changes: 1 addition & 1 deletion src/subtrees_within/moved_subtree.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,6 @@ impl<V: TreeVariant> SubTreeWithinCore<V> for MovedSubTreeWithin<V> {
let node_parent = unsafe { &mut *ptr_parent.ptr_mut() };
node_parent.next_mut().insert(child_position, ptr_child);

self.idx.clone()
self.idx
}
}
11 changes: 7 additions & 4 deletions src/tree_node_idx.rs
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ impl<V: TreeVariant> NodeIdx<V> {
/// [`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<V> {
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
Expand All @@ -264,7 +264,7 @@ impl<V: TreeVariant> NodeIdx<V> {
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
Expand All @@ -280,13 +280,16 @@ impl<V: TreeVariant> NodeIdx<V> {
where
V::Item: Copy,
{
CopiedSubTreeWithin::new(self.clone())
CopiedSubTreeWithin::new(*self)
}
}

// Only the pointer is copied, so "V" does not need to be copy itself.
impl<V: TreeVariant> Copy for NodeIdx<V> {}

impl<V: TreeVariant> Clone for NodeIdx<V> {
fn clone(&self) -> Self {
Self(self.0.clone())
*self
}
}

Expand Down