masonry: add docs for `TreeArena::get_id_path` (#573)

beats reading the implementation to know the order :-)
This commit is contained in:
Tom Churchman 2024-09-03 20:27:38 +02:00 committed by GitHub
parent e337cf745a
commit 5944aa5d0b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 4 additions and 0 deletions

View File

@ -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();