Use strip_prefix instead of replacen

This commit is contained in:
Felix Schütt
2023-01-02 10:27:00 +01:00
parent ddbe5d7986
commit de39d61937

View File

@@ -1236,11 +1236,7 @@ fn link_exe_from_dir(
}
pub(crate) fn normalize_path(s: &str) -> String {
if s.starts_with("\\\\?\\") {
s.replacen("\\\\?\\", "", 1)
} else {
s.to_string()
}
s.strip_prefix(r"\\?\").unwrap_or(s).to_string()
}
/// Link compiled objects using the system linker