Update crates/vfs/src/vfs_path.rs

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
This commit is contained in:
龙方淞 2021-09-28 10:20:35 +08:00 committed by longfangsong
parent 8f5e8e0a13
commit 51b1f7707b

View File

@ -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)
}