From 51b1f7707b0742d22241562158c8a2cf22e684d4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BE=99=E6=96=B9=E6=B7=9E?= Date: Tue, 28 Sep 2021 10:20:35 +0800 Subject: [PATCH] Update crates/vfs/src/vfs_path.rs Co-authored-by: Lukas Wirth --- crates/vfs/src/vfs_path.rs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/crates/vfs/src/vfs_path.rs b/crates/vfs/src/vfs_path.rs index 9f704d6ebe..ffd673573a 100644 --- a/crates/vfs/src/vfs_path.rs +++ b/crates/vfs/src/vfs_path.rs @@ -359,9 +359,7 @@ impl VirtualPath { } path = &path["../".len()..] } - while path.starts_with("./") { - path = &path["./".len()..] - } + path = path.trim_start_matches("./"); res.0 = format!("{}/{}", res.0, path); Some(res) }