From 8347d95159059652879792f5e4344e6c9f2cd490 Mon Sep 17 00:00:00 2001 From: Martin von Zweigbergk Date: Wed, 19 May 2021 08:36:32 -0700 Subject: [PATCH] repo_path: remove unnecessary RepoPath::new() and let caller use join() --- lib/src/repo_path.rs | 4 ---- lib/src/tree.rs | 5 +---- 2 files changed, 1 insertion(+), 8 deletions(-) diff --git a/lib/src/repo_path.rs b/lib/src/repo_path.rs index f26ee81dd..91cefff48 100644 --- a/lib/src/repo_path.rs +++ b/lib/src/repo_path.rs @@ -78,10 +78,6 @@ impl RepoPath { } } - pub fn new(dir: DirRepoPath, basename: RepoPathComponent) -> Self { - RepoPath { dir, basename } - } - pub fn from_internal_string(value: &str) -> Self { assert!(!value.ends_with('/')); match value.rfind('/') { diff --git a/lib/src/tree.rs b/lib/src/tree.rs index 6a457cf2b..c1ca9f2e3 100644 --- a/lib/src/tree.rs +++ b/lib/src/tree.rs @@ -242,10 +242,7 @@ impl Iterator for TreeEntriesIter { self.stack.push((subtree, subtree_iter)); } other => { - let path = RepoPath::new( - tree.dir().clone(), - RepoPathComponent::from(entry.name()), - ); + let path = tree.dir().join(&RepoPathComponent::from(entry.name())); return Some((path, other.clone())); } };