From f92e5b911fc7977b516e56eea1bb077938ec148e Mon Sep 17 00:00:00 2001 From: Yuya Nishihara Date: Mon, 15 Apr 2024 16:35:54 +0900 Subject: [PATCH] matchers: inline RepoPathTree::add_file() --- lib/src/matchers.rs | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/lib/src/matchers.rs b/lib/src/matchers.rs index 3d501be1f..79a1f376e 100644 --- a/lib/src/matchers.rs +++ b/lib/src/matchers.rs @@ -129,7 +129,7 @@ impl FilesMatcher { pub fn new(files: impl IntoIterator>) -> Self { let mut tree = RepoPathTree::new(); for f in files { - tree.add_file(f.as_ref()); + tree.add(f.as_ref()).is_file = true; } 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> { dir.components() .try_fold(self, |sub, name| sub.entries.get(name))