From 5944aa5d0bb77b119b4b531f7fa6d9b6411bce75 Mon Sep 17 00:00:00 2001 From: Tom Churchman Date: Tue, 3 Sep 2024 20:27:38 +0200 Subject: [PATCH] masonry: add docs for `TreeArena::get_id_path` (#573) beats reading the implementation to know the order :-) --- masonry/src/tree_arena.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/masonry/src/tree_arena.rs b/masonry/src/tree_arena.rs index bd1ce7eb..31ede65f 100644 --- a/masonry/src/tree_arena.rs +++ b/masonry/src/tree_arena.rs @@ -207,6 +207,10 @@ impl TreeArena { 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 { let mut path = Vec::new();