From cd5e82d0d3705979446d45384170b45eba2cc68e Mon Sep 17 00:00:00 2001 From: Martin von Zweigbergk Date: Wed, 22 May 2024 07:36:40 -0700 Subject: [PATCH] tree: make `sub_tree_recursive()` public These functions (in `Tree` and `MergedTree`) are safe to use. We have a duplicate of these functions at Google, which would be nice to avoid. --- lib/src/merged_tree.rs | 3 ++- lib/src/tree.rs | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/src/merged_tree.rs b/lib/src/merged_tree.rs index b1b4fe3d5..c8ab7c4ba 100644 --- a/lib/src/merged_tree.rs +++ b/lib/src/merged_tree.rs @@ -268,7 +268,8 @@ impl MergedTree { } } - fn sub_tree_recursive( + /// Look up the tree at the path indicated by `components`. + pub fn sub_tree_recursive( &self, components: RepoPathComponentsIter, ) -> BackendResult> { diff --git a/lib/src/tree.rs b/lib/src/tree.rs index 039a28d84..223aee0a7 100644 --- a/lib/src/tree.rs +++ b/lib/src/tree.rs @@ -154,7 +154,8 @@ impl Tree { self.store.get_tree(subdir, id).unwrap() } - fn sub_tree_recursive( + /// Look up the tree at the path indicated by `components`. + pub fn sub_tree_recursive( &self, components: RepoPathComponentsIter, ) -> BackendResult> {