diff --git a/lib/src/repo_path.rs b/lib/src/repo_path.rs index 8b7924de3..f26ee81dd 100644 --- a/lib/src/repo_path.rs +++ b/lib/src/repo_path.rs @@ -102,16 +102,6 @@ impl RepoPath { self.dir.to_internal_dir_string() + self.basename.value() } - pub fn to_dir_repo_path(&self) -> DirRepoPath { - if self.is_root() { - DirRepoPath::root() - } else { - self.dir.join(&DirRepoPathComponent { - value: self.basename.value.clone(), - }) - } - } - pub fn to_fs_path(&self, base: &Path) -> PathBuf { let mut result = base.to_owned(); for dir in self.dir.components() { @@ -189,14 +179,6 @@ impl DirRepoPath { result } - pub fn contains_dir(&self, other: &DirRepoPath) -> bool { - other.value.starts_with(&self.value) - } - - pub fn contains_file(&self, other: &RepoPath) -> bool { - other.dir.value.starts_with(&self.value) - } - // TODO: consider making this return a Option or similar, // where the slice would borrow from this instance. pub fn parent(&self) -> Option { @@ -439,17 +421,4 @@ mod tests { Path::new("dir/file") ); } - - #[test] - fn test_convert() { - assert_eq!(RepoPath::root().to_dir_repo_path(), DirRepoPath::root()); - assert_eq!( - RepoPath::from_internal_string("dir").to_dir_repo_path(), - DirRepoPath::from_internal_dir_string("dir/") - ); - assert_eq!( - RepoPath::from_internal_string("dir/subdir").to_dir_repo_path(), - DirRepoPath::from_internal_dir_string("dir/subdir/") - ); - } }