Unnamed repository; edit this file 'description' to name the repository.
Update crates/vfs/src/vfs_path.rs
Co-authored-by: Lukas Wirth <[email protected]>
龙方淞 2021-09-28
parent 8f5e8e0 · commit 51b1f77
-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 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)
}