From 9de76853811a64490d937ce53e7b64547a57c3cc Mon Sep 17 00:00:00 2001 From: mrbeanc Date: Sun, 24 Dec 2023 22:35:50 +0800 Subject: [PATCH] =?UTF-8?q?Revert=20"fix=20path=20=E8=B7=A8=E7=B3=BB?= =?UTF-8?q?=E7=BB=9F=E4=B8=8D=E4=B8=80=E8=87=B4"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 263cd36acc146e98d42d70fedea5c66352238e4c. --- src/utils/util.rs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/utils/util.rs b/src/utils/util.rs index d81424a..1e0b06f 100644 --- a/src/utils/util.rs +++ b/src/utils/util.rs @@ -335,8 +335,7 @@ pub fn get_relative_path(path: &Path, dir: &Path) -> PathBuf { rel_path.push(".."); _dir.pop(); } - let rel_path = rel_path.join(abs_path.strip_prefix(common_dir).unwrap()); - return unify_path_separator(&rel_path); + rel_path.join(abs_path.strip_prefix(common_dir).unwrap()) } /// 获取两个路径的公共目录 @@ -424,7 +423,7 @@ pub fn clean_win_abs_path_pre(path: PathBuf) -> PathBuf { /// 获取绝对路径(相对于目录current_dir) 不论是否存在 pub fn get_absolute_path(path: &Path) -> PathBuf { - unify_path_separator(get_absolute_path_to_dir(path, &std::env::current_dir().unwrap()).as_path()) + get_absolute_path_to_dir(path, &std::env::current_dir().unwrap()) } /// 获取绝对路径(相对于目录dir) 不论是否存在