Skip to content

Commit

Permalink
feat: add TreeItem::children()
Browse files Browse the repository at this point in the history
returns all the current children
  • Loading branch information
EdJoPaTo committed Sep 1, 2022
1 parent 2adcbcc commit c8c5a37
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,10 @@ impl<'a> TreeItem<'a> {
}
}

pub fn children(&self) -> &[TreeItem] {
&self.children
}

pub fn child(&self, index: usize) -> Option<&Self> {
self.children.get(index)
}
Expand Down

0 comments on commit c8c5a37

Please sign in to comment.