Skip to content

Commit 04f4149

Browse files
committed
more
1 parent 0e8b65e commit 04f4149

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

src/trees/tree.rs

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,14 +99,21 @@ impl<'treeseq> Tree<'treeseq> {
9999

100100
/// Return the virtual root of the tree.
101101
pub fn virtual_root(&self) -> NodeId {
102-
self.inner.virtual_root().into()
102+
self.inner.virtual_root()
103103
}
104104

105105
/// Get the left sib of node `u`.
106106
///
107107
/// Returns `None` if `u` is out of range.
108108
pub fn left_sib<N: Into<NodeId> + Copy>(&self, u: N) -> Option<NodeId> {
109-
self.inner.left_sib(u.into()).map(|x| x.into())
109+
self.inner.left_sib(u.into())
110+
}
111+
112+
/// Get the right child of node `u`.
113+
///
114+
/// Returns `None` if `u` is out of range.
115+
pub fn right_child<N: Into<NodeId> + Copy>(&self, u: N) -> Option<NodeId> {
116+
self.inner.left_sib(u.into())
110117
}
111118
}
112119

0 commit comments

Comments
 (0)