Path overhaul

This commit is contained in:
Roey Darwish Dror
2018-07-07 02:18:19 +03:00
parent 535d49f1c2
commit 445ad96c10
6 changed files with 30 additions and 79 deletions

View File

@@ -1,5 +1,4 @@
use failure::Error;
use std::env::home_dir;
use std::ffi::OsStr;
use std::fmt::Debug;
use std::path::{Path, PathBuf};
@@ -23,13 +22,6 @@ impl Check for ExitStatus {
}
}
}
pub fn home_path(p: &str) -> PathBuf {
let mut path = home_dir().unwrap();
path.push(p);
path
}
pub fn is_ancestor(ancestor: &Path, path: &Path) -> bool {
let mut p = path;
while let Some(parent) = p.parent() {