Skip to content

Commit 143afa6

Browse files
committed
correct to_* into into_* for semantic correctness
1 parent 9f3d03d commit 143afa6

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/serde.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,12 +41,12 @@ struct DeserNode<T> {
4141
}
4242

4343
impl<T> DeserNode<T> {
44-
fn to_tree_node(self, tree: &mut Tree<T>, parent: NodeId) -> NodeId {
44+
fn into_tree_node(self, tree: &mut Tree<T>, parent: NodeId) -> NodeId {
4545
let mut parent = tree.get_mut(parent).unwrap();
4646
let node = parent.append(self.value).id();
4747

4848
for child in self.children {
49-
child.to_tree_node(tree, node);
49+
child.into_tree_node(tree, node);
5050
}
5151

5252
node
@@ -59,7 +59,7 @@ impl<T> From<DeserNode<T>> for Tree<T> {
5959
let root_id = tree.root().id;
6060

6161
for child in root.children {
62-
child.to_tree_node(&mut tree, root_id);
62+
child.into_tree_node(&mut tree, root_id);
6363
}
6464

6565
tree

0 commit comments

Comments
 (0)