forked from mirrors/jj
matchers: inline RepoPathTree::add_file()
This commit is contained in:
parent
0153cc1bc7
commit
f92e5b911f
1 changed files with 1 additions and 5 deletions
|
@ -129,7 +129,7 @@ impl FilesMatcher {
|
||||||
pub fn new(files: impl IntoIterator<Item = impl AsRef<RepoPath>>) -> Self {
|
pub fn new(files: impl IntoIterator<Item = impl AsRef<RepoPath>>) -> Self {
|
||||||
let mut tree = RepoPathTree::new();
|
let mut tree = RepoPathTree::new();
|
||||||
for f in files {
|
for f in files {
|
||||||
tree.add_file(f.as_ref());
|
tree.add(f.as_ref()).is_file = true;
|
||||||
}
|
}
|
||||||
FilesMatcher { tree }
|
FilesMatcher { tree }
|
||||||
}
|
}
|
||||||
|
@ -369,10 +369,6 @@ impl RepoPathTree {
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
fn add_file(&mut self, file: &RepoPath) {
|
|
||||||
self.add(file).is_file = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
fn get(&self, dir: &RepoPath) -> Option<&RepoPathTree> {
|
fn get(&self, dir: &RepoPath) -> Option<&RepoPathTree> {
|
||||||
dir.components()
|
dir.components()
|
||||||
.try_fold(self, |sub, name| sub.entries.get(name))
|
.try_fold(self, |sub, name| sub.entries.get(name))
|
||||||
|
|
Loading…
Reference in a new issue