From 061a0966008860965245d417786554d1b3b49f64 Mon Sep 17 00:00:00 2001 From: Lucien Greathouse Date: Tue, 24 Sep 2019 17:55:39 -0700 Subject: [PATCH] Add PathMap::orphans for traversing the map's roots --- src/path_map.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/path_map.rs b/src/path_map.rs index 506f29f4..9ccf11ea 100644 --- a/src/path_map.rs +++ b/src/path_map.rs @@ -156,6 +156,10 @@ impl PathMap { current_path } + pub fn orphans(&self) -> impl Iterator { + self.orphan_paths.iter().map(|item| item.as_ref()) + } + /// Adds the path to its parent if it's present in the tree, or the set of /// orphaned paths if it is not. fn add_to_parent(&mut self, path: PathBuf) {