about summary refs log tree commit diff
diff options
context:
space:
mode:
author龙方淞 <longfangsong@icloud.com>2021-09-28 10:20:35 +0800
committerlongfangsong <longfangsong@icloud.com>2021-09-28 10:20:35 +0800
commit51b1f7707b0742d22241562158c8a2cf22e684d4 (patch)
tree5ecb7809b740a8b936de985302aef2f4a3f373a4
parent8f5e8e0a13cb9987c789a244f9c31e60d148a3a6 (diff)
downloadrust-51b1f7707b0742d22241562158c8a2cf22e684d4.tar.gz
rust-51b1f7707b0742d22241562158c8a2cf22e684d4.zip
Update crates/vfs/src/vfs_path.rs
Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
-rw-r--r--crates/vfs/src/vfs_path.rs4
1 files changed, 1 insertions, 3 deletions
diff --git a/crates/vfs/src/vfs_path.rs b/crates/vfs/src/vfs_path.rs
index 9f704d6ebe5..ffd673573a5 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)
     }