ok/jj
1
0
Fork 0
forked from mirrors/jj

matchers: inline RepoPathTree::get_visit_sets()

This commit is contained in:
Yuya Nishihara 2024-04-15 16:37:03 +09:00
parent 8e196d0025
commit e0d5217450

View file

@ -141,7 +141,9 @@ impl Matcher for FilesMatcher {
}
fn visit(&self, dir: &RepoPath) -> Visit {
self.tree.get_visit_sets(dir)
self.tree
.get(dir)
.map_or(Visit::Nothing, RepoPathTree::to_visit_sets)
}
}
@ -366,12 +368,6 @@ impl RepoPathTree {
.try_fold(self, |sub, name| sub.entries.get(name))
}
fn get_visit_sets(&self, dir: &RepoPath) -> Visit {
self.get(dir)
.map(RepoPathTree::to_visit_sets)
.unwrap_or(Visit::Nothing)
}
/// Walks the tree from the root to the given `dir`, yielding each sub tree
/// and remaining path.
fn walk_to<'a, 'b: 'a>(