Skip to content

Commit

Permalink
masonry: add docs for TreeArena::get_id_path (#573)
Browse files Browse the repository at this point in the history
beats reading the implementation to know the order :-)
  • Loading branch information
tomcur authored Sep 3, 2024
1 parent e337cf7 commit 5944aa5
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions masonry/src/tree_arena.rs
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,10 @@ impl<Item> TreeArena<Item> {
Some(node.arena_mut(self.parents_map[&id], &mut self.parents_map))
}

/// Construct the path of items from the given item to the root of the tree.
///
/// The path is in order from the bottom to the top, starting at the given item and ending at
/// the root.
pub fn get_id_path(&self, id: u64) -> Vec<u64> {
let mut path = Vec::new();

Expand Down

0 comments on commit 5944aa5

Please sign in to comment.