mirror of
https://github.com/MrBeanCpp/MIT.git
synced 2026-04-15 19:10:57 +08:00
解决TODO&创建TODO
This commit is contained in:
@@ -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())
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user