解决TODO&创建TODO

This commit is contained in:
HouXiaoxuan
2023-12-21 19:15:43 +08:00
parent c54f7896f4
commit 526210b1db
4 changed files with 25 additions and 21 deletions

View File

@@ -153,7 +153,6 @@ pub fn list_files(path: &Path) -> io::Result<Vec<PathBuf>> {
}
/// 获取相对于dir的相对路径
/// XXX 是否只能用在windows是否检查dir是否是path的父目录
pub fn get_relative_path(path: &Path, dir: &Path) -> PathBuf {
let path = if path.is_relative() {
get_absolute_path(path)
@@ -165,7 +164,7 @@ pub fn get_relative_path(path: &Path, dir: &Path) -> PathBuf {
}
/// 获取相较于工作区(Working Dir)的相对路径
pub fn to_root_relative_path(path: &Path) -> PathBuf { //todo: rename
pub fn to_workdir_relative_path(path: &Path) -> PathBuf {
get_relative_path(path, &get_working_dir().unwrap())
}